R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- c(126.81,125.8,123.07,119.52,118.03,117.27,117.27,116.69,115.38,114.31,113.33,111.79,111.79,110.92,109.37,107.04,104.72,104.14,104.14,102.95,102.13,101.01,100.07,99.4,99.4,99.34,97.72,96.26,95.77,95.04,95.04,94.55,94,93.14,91.21,90.3,90.3,89.74,89.07,89.06,88.97,88.78,88.78,88.23,87.91,87.79,87.89,88,88,87.08,85.75,84.29,84.39,83.72,83.72,81.76,81.53,80.55,79.83,78.98,78.98,78.27,77.41,76.75,76.38,74.96,74.96,74.46,74.04,73.22,72.97,72.91) > par1 = '12' > par1 <- '12' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Mean Plot (v1.0.4) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_meanplot.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > par1 <- as.numeric(par1) > (n <- length(x)) [1] 72 > (np <- floor(n / par1)) [1] 6 > arr <- array(NA,dim=c(par1,np+1)) > darr <- array(NA,dim=c(par1,np+1)) > ari <- array(0,dim=par1) > dx <- diff(x) > j <- 0 > for (i in 1:n) + { + j = j + 1 + ari[j] = ari[j] + 1 + arr[j,ari[j]] <- x[i] + darr[j,ari[j]] <- dx[i] + if (j == par1) j = 0 + } > ari [1] 6 6 6 6 6 6 6 6 6 6 6 6 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 126.81 111.79 99.40 90.30 88.00 78.98 NA [2,] 125.80 110.92 99.34 89.74 87.08 78.27 NA [3,] 123.07 109.37 97.72 89.07 85.75 77.41 NA [4,] 119.52 107.04 96.26 89.06 84.29 76.75 NA [5,] 118.03 104.72 95.77 88.97 84.39 76.38 NA [6,] 117.27 104.14 95.04 88.78 83.72 74.96 NA [7,] 117.27 104.14 95.04 88.78 83.72 74.96 NA [8,] 116.69 102.95 94.55 88.23 81.76 74.46 NA [9,] 115.38 102.13 94.00 87.91 81.53 74.04 NA [10,] 114.31 101.01 93.14 87.79 80.55 73.22 NA [11,] 113.33 100.07 91.21 87.89 79.83 72.97 NA [12,] 111.79 99.40 90.30 88.00 78.98 72.91 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.01 -0.87 -0.06 -0.56 -0.92 -0.71 NA [2,] -2.73 -1.55 -1.62 -0.67 -1.33 -0.86 NA [3,] -3.55 -2.33 -1.46 -0.01 -1.46 -0.66 NA [4,] -1.49 -2.32 -0.49 -0.09 0.10 -0.37 NA [5,] -0.76 -0.58 -0.73 -0.19 -0.67 -1.42 NA [6,] 0.00 0.00 0.00 0.00 0.00 0.00 NA [7,] -0.58 -1.19 -0.49 -0.55 -1.96 -0.50 NA [8,] -1.31 -0.82 -0.55 -0.32 -0.23 -0.42 NA [9,] -1.07 -1.12 -0.86 -0.12 -0.98 -0.82 NA [10,] -0.98 -0.94 -1.93 0.10 -0.72 -0.25 NA [11,] -1.54 -0.67 -0.91 0.11 -0.85 -0.06 NA [12,] 0.00 0.00 0.00 0.00 0.00 NA NA > arr.mean <- array(NA,dim=par1) > arr.median <- array(NA,dim=par1) > arr.midrange <- array(NA,dim=par1) > for (j in 1:par1) + { + arr.mean[j] <- mean(arr[j,],na.rm=TRUE) + arr.median[j] <- median(arr[j,],na.rm=TRUE) + arr.midrange[j] <- (quantile(arr[j,],0.75,na.rm=TRUE) + quantile(arr[j,],0.25,na.rm=TRUE)) / 2 + } > overall.mean <- mean(x) > overall.median <- median(x) > overall.midrange <- (quantile(x,0.75) + quantile(x,0.25)) / 2 > postscript(file="/var/wessaorg/rcomp/tmp/16mmw1350640032.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.mean,type='b',ylab='mean',main='Mean Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.mean,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2iopy1350640032.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.median,type='b',ylab='median',main='Median Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.median,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3g81p1350640032.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.midrange,type='b',ylab='midrange',main='Midrange Plot',xlab='Periodic Index') > mtext(paste('#blocks = ',np)) > abline(overall.midrange,0) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/4prj81350640032.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(t(arr)) > names(z) <- c(1:par1) > (boxplot(z,notch=TRUE,col='grey',xlab='Periodic Index',ylab='Value',main='Notched Box Plots - Periodic Subseries')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 78.98 78.27 77.410 76.75 76.38 74.96 74.96 74.46 74.040 73.220 [2,] 88.00 87.08 85.750 84.29 84.39 83.72 83.72 81.76 81.530 80.550 [3,] 94.85 94.54 93.395 92.66 92.37 91.91 91.91 91.39 90.955 90.465 [4,] 111.79 110.92 109.370 107.04 104.72 104.14 104.14 102.95 102.130 101.010 [5,] 126.81 125.80 123.070 119.52 118.03 117.27 117.27 116.69 115.380 114.310 [,11] [,12] [1,] 72.97 72.91 [2,] 79.83 78.98 [3,] 89.55 89.15 [4,] 100.07 99.40 [5,] 113.33 111.79 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 79.50468 79.16243 78.15934 77.98552 79.25649 78.73844 78.73844 [2,] 110.19532 109.91757 108.63066 107.33448 105.48351 105.08156 105.08156 [,8] [,9] [,10] [,11] [,12] [1,] 77.72177 77.66733 77.26764 76.49455 75.97844 [2,] 105.05823 104.24267 103.66236 102.60545 102.32156 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(78.98, 88, 94.85, 111.79, 126.81, 78.27, 87.08, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5s3c91350640032.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(t(darr)) > names(z) <- c(1:par1) > (boxplot(z,notch=TRUE,col='grey',xlab='Periodic Index',ylab='Value',main='Notched Box Plots - Differenced Periodic Subseries')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] -1.01 -2.73 -3.55 -2.32 -0.76 0 -1.960 -1.310 -1.12 -1.93 -1.54 0 [2,] -0.92 -1.62 -2.33 -1.49 -0.76 0 -1.190 -0.820 -1.07 -0.98 -0.91 0 [3,] -0.79 -1.44 -1.46 -0.43 -0.70 0 -0.565 -0.485 -0.92 -0.83 -0.76 0 [4,] -0.56 -0.86 -0.66 -0.09 -0.58 0 -0.500 -0.320 -0.82 -0.25 -0.06 0 [5,] -0.06 -0.67 -0.01 0.10 -0.58 0 -0.490 -0.230 -0.82 0.10 0.11 0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1.0222116 -1.9302245 -2.5372039 -1.3330452 -0.8161058 0 -1.0100723 [2,] -0.5577884 -0.9497755 -0.3827961 0.4730452 -0.5838942 0 -0.1199277 [,8] [,9] [,10] [,11] [,12] [1,] -0.8075161 -1.0812581 -1.3008736 -1.3082775 0 [2,] -0.1624839 -0.7587419 -0.3591264 -0.2117225 0 $out [1] -0.19 -1.42 -0.12 $group [1] 5 5 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1.01000000000001, -0.920000000000002, -0.790000000000006, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6m3pd1350640032.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(arr) > names(z) <- c(1:np) > (boxplot(z,notch=TRUE,col='grey',xlab='Block Index',ylab='Value',main='Notched Box Plots - Sequential Blocks')) $stats [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 111.790 99.400 90.30 87.790 78.98 72.91 NA [2,] 114.845 101.570 93.57 87.955 81.04 73.63 NA [3,] 117.270 104.140 95.04 88.780 83.72 74.96 NA [4,] 121.295 108.205 96.99 89.065 85.07 77.08 NA [5,] 126.810 111.790 99.40 90.300 88.00 78.98 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 114.3281 101.1137 93.48012 88.27372 81.88189 73.38643 NA [2,] 120.2119 107.1663 96.59988 89.28628 85.55811 76.53357 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(111.79, 114.845, 117.27, 121.295, 126.81, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7yx6n1350640032.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > z <- data.frame(cbind(arr.mean,arr.median,arr.midrange)) > names(z) <- list('mean','median','midrange') > (boxplot(z,notch=TRUE,col='grey',ylab='Overall Central Tendency',main='Notched Box Plots')) $stats [,1] [,2] [,3] [1,] 90.23000 89.1500 89.18000 [2,] 92.08417 90.7100 91.15625 [3,] 93.98500 91.9100 93.42500 [4,] 96.27583 93.0275 95.71625 [5,] 99.21333 94.8500 98.63375 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 92.07315 90.85297 91.34515 [2,] 95.89685 92.96703 95.50485 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(90.23, 92.0841666666667, 93.985, 96.2758333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/16mmw1350640032.ps tmp/16mmw1350640032.png",intern=TRUE)) character(0) > try(system("convert tmp/2iopy1350640032.ps tmp/2iopy1350640032.png",intern=TRUE)) character(0) > try(system("convert tmp/3g81p1350640032.ps tmp/3g81p1350640032.png",intern=TRUE)) character(0) > try(system("convert tmp/4prj81350640032.ps tmp/4prj81350640032.png",intern=TRUE)) character(0) > try(system("convert tmp/5s3c91350640032.ps tmp/5s3c91350640032.png",intern=TRUE)) character(0) > try(system("convert tmp/6m3pd1350640032.ps tmp/6m3pd1350640032.png",intern=TRUE)) character(0) > try(system("convert tmp/7yx6n1350640032.ps tmp/7yx6n1350640032.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.441 0.580 4.012