R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(1.4718,1.4748,1.5527,1.5751,1.5557,1.5553,1.577,1.4975,1.437,1.3322,1.2732,1.3449,1.3239,1.2785,1.305,1.319,1.365,1.4016,1.4088,1.4268,1.4562,1.4816,1.4914,1.4614,1.4272,1.3686,1.3569,1.3406,1.2565,1.2209,1.277,1.2894,1.3067,1.3898,1.3661,1.322,1.336,1.3649,1.3999,1.4442,1.4349,1.4388,1.4264,1.4343,1.377,1.3706,1.3556,1.3179,1.2905,1.3224,1.3201,1.3162,1.2789,1.2526,1.2288,1.24,1.2856,1.2974,1.2828,1.3119,1.3288,1.3359,1.2964,1.3026,1.2982,1.3189,1.308,1.331,1.3348,1.3635,1.3493,1.3704) > 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,] 1.4718 1.3239 1.4272 1.3360 1.2905 1.3288 NA [2,] 1.4748 1.2785 1.3686 1.3649 1.3224 1.3359 NA [3,] 1.5527 1.3050 1.3569 1.3999 1.3201 1.2964 NA [4,] 1.5751 1.3190 1.3406 1.4442 1.3162 1.3026 NA [5,] 1.5557 1.3650 1.2565 1.4349 1.2789 1.2982 NA [6,] 1.5553 1.4016 1.2209 1.4388 1.2526 1.3189 NA [7,] 1.5770 1.4088 1.2770 1.4264 1.2288 1.3080 NA [8,] 1.4975 1.4268 1.2894 1.4343 1.2400 1.3310 NA [9,] 1.4370 1.4562 1.3067 1.3770 1.2856 1.3348 NA [10,] 1.3322 1.4816 1.3898 1.3706 1.2974 1.3635 NA [11,] 1.2732 1.4914 1.3661 1.3556 1.2828 1.3493 NA [12,] 1.3449 1.4614 1.3220 1.3179 1.3119 1.3704 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.0030 -0.0454 -0.0586 0.0289 0.0319 0.0071 NA [2,] 0.0779 0.0265 -0.0117 0.0350 -0.0023 -0.0395 NA [3,] 0.0224 0.0140 -0.0163 0.0443 -0.0039 0.0062 NA [4,] -0.0194 0.0460 -0.0841 -0.0093 -0.0373 -0.0044 NA [5,] -0.0004 0.0366 -0.0356 0.0039 -0.0263 0.0207 NA [6,] 0.0217 0.0072 0.0561 -0.0124 -0.0238 -0.0109 NA [7,] -0.0795 0.0180 0.0124 0.0079 0.0112 0.0230 NA [8,] -0.0605 0.0294 0.0173 -0.0573 0.0456 0.0038 NA [9,] -0.1048 0.0254 0.0831 -0.0064 0.0118 0.0287 NA [10,] -0.0590 0.0098 -0.0237 -0.0150 -0.0146 -0.0142 NA [11,] 0.0717 -0.0300 -0.0441 -0.0377 0.0291 0.0211 NA [12,] -0.0210 -0.0342 0.0140 -0.0274 0.0169 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/13cbd1413477176.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/27fbm1413477176.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/38eht1413477176.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/42u2o1413477176.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,] 1.2905 1.2785 1.2964 1.3026 1.2565 1.22090 1.2288 1.2400 1.2856 1.29740 [2,] 1.3239 1.3224 1.3050 1.3162 1.2789 1.25260 1.2770 1.2894 1.3067 1.33220 [3,] 1.3324 1.3504 1.3385 1.3298 1.3316 1.36025 1.3584 1.3789 1.3559 1.36705 [4,] 1.4272 1.3686 1.3999 1.4442 1.4349 1.43880 1.4264 1.4343 1.4370 1.38980 [5,] 1.4718 1.3686 1.3999 1.5751 1.5557 1.55530 1.5770 1.4975 1.4562 1.38980 [,11] [,12] [1,] 1.27320 1.31190 [2,] 1.28280 1.31790 [3,] 1.35245 1.33345 [4,] 1.36610 1.37040 [5,] 1.36610 1.37040 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.265768 1.3206 1.277286 1.247236 1.230975 1.240145 1.262032 1.285435 [2,] 1.399032 1.3802 1.399714 1.412364 1.432225 1.480355 1.454768 1.472365 [,9] [,10] [,11] [,12] [1,] 1.271852 1.329896 1.298719 1.299586 [2,] 1.439948 1.404204 1.406181 1.367314 $out [1] 1.4748 1.5527 1.4816 1.4914 1.4614 $group [1] 2 3 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(1.2905, 1.3239, 1.3324, 1.4272, 1.4718, 1.2785, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5gq0o1413477176.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] [1,] -0.05860 -0.0395 -0.0163 -0.08410 -0.03560 -0.02380 0.0079 -0.06050 [2,] -0.04540 -0.0117 -0.0039 -0.03730 -0.02630 -0.01240 0.0079 -0.05730 [3,] 0.00505 0.0121 0.0101 -0.01435 0.00175 -0.00185 0.0118 0.01055 [4,] 0.02890 0.0350 0.0224 -0.00440 0.02070 0.02170 0.0180 0.02940 [5,] 0.03190 0.0779 0.0443 -0.00440 0.03660 0.05610 0.0230 0.04560 [,9] [,10] [,11] [,12] [1,] -0.0064 -0.0237 -0.04410 -0.0342 [2,] -0.0064 -0.0237 -0.03770 -0.0274 [3,] 0.0186 -0.0148 -0.00445 -0.0210 [4,] 0.0287 -0.0142 0.02910 0.0140 [5,] 0.0287 -0.0142 0.07170 0.0169 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.0428759 -0.01802301 -0.006864349 -0.035571563 -0.02856652 -0.0238456 [2,] 0.0529759 0.04222301 0.027064349 0.006871563 0.03206652 0.0201456 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.005285174 -0.0453743 -0.004040634 -0.020927807 -0.04753816 -0.050253136 [2,] 0.018314826 0.0664743 0.041240634 -0.008672193 0.03863816 0.008253136 $out [1] 0.0460 -0.0795 -0.1048 0.0831 -0.0590 0.0098 $group [1] 4 7 9 9 10 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-0.0586, -0.0454000000000001, 0.00505000000000011, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6rysv1413477176.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,] 1.27320 1.27850 1.22090 1.31790 1.22880 1.2964 NA [2,] 1.39095 1.32145 1.28320 1.36025 1.26575 1.3053 NA [3,] 1.48615 1.40520 1.33130 1.38845 1.28805 1.3299 NA [4,] 1.55550 1.45880 1.36735 1.43460 1.31405 1.3426 NA [5,] 1.57700 1.49140 1.42720 1.44420 1.32240 1.3704 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.411098 1.342554 1.292919 1.354538 1.26602 1.312887 NA [2,] 1.561202 1.467846 1.369681 1.422362 1.31008 1.346913 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(1.2732, 1.39095, 1.48615, 1.5555, 1.577, 1.2785, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7vrz91413477176.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,] 1.353067 1.329800 1.331450 [2,] 1.360275 1.332925 1.347844 [3,] 1.365542 1.351425 1.351975 [4,] 1.371417 1.359325 1.365438 [5,] 1.382950 1.378900 1.367862 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 1.360460 1.339384 1.34395 [2,] 1.370623 1.363466 1.36000 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.35306666666667, 1.360275, 1.36554166666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/13cbd1413477176.ps tmp/13cbd1413477176.png",intern=TRUE)) character(0) > try(system("convert tmp/27fbm1413477176.ps tmp/27fbm1413477176.png",intern=TRUE)) character(0) > try(system("convert tmp/38eht1413477176.ps tmp/38eht1413477176.png",intern=TRUE)) character(0) > try(system("convert tmp/42u2o1413477176.ps tmp/42u2o1413477176.png",intern=TRUE)) character(0) > try(system("convert tmp/5gq0o1413477176.ps tmp/5gq0o1413477176.png",intern=TRUE)) character(0) > try(system("convert tmp/6rysv1413477176.ps tmp/6rysv1413477176.png",intern=TRUE)) character(0) > try(system("convert tmp/7vrz91413477176.ps tmp/7vrz91413477176.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.522 0.482 3.029