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(155.28,173.24,180.16,181.52,182.25,182.19,182,181.65,180.07,182.62,180.38,181.15,180.5,181.14,180.93,211.91,223.81,226.88,226.8,231.81,232.06,232.32,228.37,226.31,225.72,219.98,219.31,215.19,213.81,213.7,213.6,213.52,218.39,219.97,221.09,219.17,219.17,218.45,216.88,216.19,214.59,269.87,272.71,280.35,274.5,268.86,261.7,263.98,263.01,262.79,263.59,267,267.89,267.86,266.84,268.24,267.67,269.07,270.87,271.68,271.63,275.21,276.66,276.08,278.3,279.06,279.28,279.12,262.72,262.55,260.7,259.14) > 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,] 155.28 180.50 225.72 219.17 263.01 271.63 NA [2,] 173.24 181.14 219.98 218.45 262.79 275.21 NA [3,] 180.16 180.93 219.31 216.88 263.59 276.66 NA [4,] 181.52 211.91 215.19 216.19 267.00 276.08 NA [5,] 182.25 223.81 213.81 214.59 267.89 278.30 NA [6,] 182.19 226.88 213.70 269.87 267.86 279.06 NA [7,] 182.00 226.80 213.60 272.71 266.84 279.28 NA [8,] 181.65 231.81 213.52 280.35 268.24 279.12 NA [9,] 180.07 232.06 218.39 274.50 267.67 262.72 NA [10,] 182.62 232.32 219.97 268.86 269.07 262.55 NA [11,] 180.38 228.37 221.09 261.70 270.87 260.70 NA [12,] 181.15 226.31 219.17 263.98 271.68 259.14 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 17.96 0.64 -5.74 -0.72 -0.22 3.58 NA [2,] 6.92 -0.21 -0.67 -1.57 0.80 1.45 NA [3,] 1.36 30.98 -4.12 -0.69 3.41 -0.58 NA [4,] 0.73 11.90 -1.38 -1.60 0.89 2.22 NA [5,] -0.06 3.07 -0.11 55.28 -0.03 0.76 NA [6,] -0.19 -0.08 -0.10 2.84 -1.02 0.22 NA [7,] -0.35 5.01 -0.08 7.64 1.40 -0.16 NA [8,] -1.58 0.25 4.87 -5.85 -0.57 -16.40 NA [9,] 2.55 0.26 1.58 -5.64 1.40 -0.17 NA [10,] -2.24 -3.95 1.12 -7.16 1.80 -1.85 NA [11,] 0.77 -2.06 -1.92 2.28 0.81 -1.56 NA [12,] -0.65 -0.59 0.00 -0.97 -0.05 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/1piwb1350826289.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/2hckd1350826289.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/3k38g1350826289.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/4xt3k1350826289.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,] 155.280 173.240 180.160 181.52 182.25 182.19 182.00 181.650 180.07 182.620 [2,] 180.500 181.140 180.930 211.91 213.81 213.70 213.60 213.520 218.39 219.970 [3,] 222.445 219.215 218.095 215.69 219.20 247.37 246.82 250.025 247.39 247.435 [4,] 263.010 262.790 263.590 267.00 267.89 269.87 272.71 279.120 267.67 268.860 [5,] 271.630 275.210 276.660 276.08 278.30 279.06 279.28 280.350 274.50 269.070 [,11] [,12] [1,] 180.380 181.150 [2,] 221.090 219.170 [3,] 244.535 242.725 [4,] 261.700 263.980 [5,] 270.870 271.680 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 169.2234 166.5481 164.7766 180.1552 184.3167 211.1385 208.6921 207.7109 [2,] 275.6666 271.8819 271.4134 251.2248 254.0833 283.6015 284.9479 292.3391 [,9] [,10] [,11] [,12] [1,] 215.6028 215.8994 218.3402 213.8211 [2,] 279.1772 278.9706 270.7298 271.6289 $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(155.28, 180.5, 222.445, 263.01, 271.63, 173.24, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/53rl91350826289.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] [1,] -5.74 -1.570 -4.12 -1.60 -0.110 -0.19 -0.35 -5.850 -0.17 -7.160 -2.060 [2,] -0.72 -0.670 -0.69 -1.38 -0.060 -0.19 -0.16 -5.850 -0.17 -3.950 -1.920 [3,] 0.21 0.295 0.39 0.81 0.365 -0.09 0.66 -1.075 0.83 -2.045 -0.395 [4,] 3.58 1.450 3.41 2.22 3.070 0.22 5.01 0.250 1.58 1.120 0.810 [5,] 3.58 1.450 3.41 2.22 3.070 0.22 7.64 4.870 2.55 1.800 2.280 [,12] [1,] -0.97 [2,] -0.65 [3,] -0.59 [4,] -0.05 [5,] 0.00 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2.563639 -1.072468 -2.254632 -1.512116 -1.653951 -0.3544632 -2.674817 [2,] 2.983639 1.662468 3.034632 3.132116 2.383951 0.1744632 3.994817 [,8] [,9] [,10] [,11] [,12] [1,] -5.009697 -0.2988065 -5.315314 -2.155938 -1.0139585 [2,] 2.859697 1.9588065 1.225314 1.365938 -0.1660415 $out [1] 17.96 6.92 30.98 11.90 55.28 2.84 -1.02 -16.40 -5.64 $group [1] 1 2 3 4 5 6 6 8 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-5.74000000000001, -0.719999999999999, 0.210000000000008, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68hoi1350826289.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,] 180.070 180.500 213.520 214.590 262.790 259.140 NA [2,] 180.115 196.525 213.755 217.665 265.215 262.635 NA [3,] 181.335 226.555 218.780 262.840 267.765 275.645 NA [4,] 182.095 230.090 219.975 271.290 268.655 278.680 NA [5,] 182.620 232.320 225.720 280.350 271.680 279.280 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 180.4319 211.2458 215.943 238.3813 266.196 268.3268 NA [2,] 182.2381 241.8642 221.617 287.2987 269.334 282.9632 NA $out [1] 155.28 173.24 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(180.07, 180.115, 181.335, 182.095, 182.62, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7zkf81350826289.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,] 219.2183 215.6900 221.2188 [2,] 225.4517 219.2075 227.7206 [3,] 237.0450 243.6300 242.0213 [4,] 239.5808 247.3800 244.0956 [5,] 242.4483 250.0250 247.2463 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 230.6006 230.7803 234.5525 [2,] 243.4894 256.4797 249.4900 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(219.218333333333, 225.451666666667, 237.045, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1piwb1350826289.ps tmp/1piwb1350826289.png",intern=TRUE)) character(0) > try(system("convert tmp/2hckd1350826289.ps tmp/2hckd1350826289.png",intern=TRUE)) character(0) > try(system("convert tmp/3k38g1350826289.ps tmp/3k38g1350826289.png",intern=TRUE)) character(0) > try(system("convert tmp/4xt3k1350826289.ps tmp/4xt3k1350826289.png",intern=TRUE)) character(0) > try(system("convert tmp/53rl91350826289.ps tmp/53rl91350826289.png",intern=TRUE)) character(0) > try(system("convert tmp/68hoi1350826289.ps tmp/68hoi1350826289.png",intern=TRUE)) character(0) > try(system("convert tmp/7zkf81350826289.ps tmp/7zkf81350826289.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.461 0.541 3.993