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(12849,11380,12079,11366,11328,10444,10854,10434,10137,10992,10906,12367,14371,11695,11546,10922,10670,10254,10573,10239,10253,11176,10719,11817,12487,11519,12025,10976,11276,10657,11141,10423,10640,11426,10948,12540,12200,10644,12044,11338,11292,10612,10995,10686,10635,11285,11475,12535,12490,12511,12799,11876,11602,11062,11055,10855,10704,11510,11663,12686,13516,12539,13811,12354,11441,10814,11261,10788,10326,11490,11029,11876) > 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,] 12849 14371 12487 12200 12490 13516 NA [2,] 11380 11695 11519 10644 12511 12539 NA [3,] 12079 11546 12025 12044 12799 13811 NA [4,] 11366 10922 10976 11338 11876 12354 NA [5,] 11328 10670 11276 11292 11602 11441 NA [6,] 10444 10254 10657 10612 11062 10814 NA [7,] 10854 10573 11141 10995 11055 11261 NA [8,] 10434 10239 10423 10686 10855 10788 NA [9,] 10137 10253 10640 10635 10704 10326 NA [10,] 10992 11176 11426 11285 11510 11490 NA [11,] 10906 10719 10948 11475 11663 11029 NA [12,] 12367 11817 12540 12535 12686 11876 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1469 -2676 -968 -1556 21 -977 NA [2,] 699 -149 506 1400 288 1272 NA [3,] -713 -624 -1049 -706 -923 -1457 NA [4,] -38 -252 300 -46 -274 -913 NA [5,] -884 -416 -619 -680 -540 -627 NA [6,] 410 319 484 383 -7 447 NA [7,] -420 -334 -718 -309 -200 -473 NA [8,] -297 14 217 -51 -151 -462 NA [9,] 855 923 786 650 806 1164 NA [10,] -86 -457 -478 190 153 -461 NA [11,] 1461 1098 1592 1060 1023 847 NA [12,] 2004 670 -340 -45 830 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/1ysbx1413624065.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/2rycz1413624065.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/39nq61413624065.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/4h94s1413624065.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,] 12200.0 10644 11546.0 10922 11276 10254.0 10573 10239 10137.0 10992.0 [2,] 12487.0 11380 12025.0 10976 11276 10444.0 10854 10423 10253.0 11176.0 [3,] 12669.5 11607 12061.5 11352 11310 10634.5 11025 10560 10480.5 11355.5 [4,] 13516.0 12511 12799.0 11876 11441 10814.0 11141 10788 10640.0 11490.0 [5,] 14371.0 12539 13811.0 12354 11602 11062.0 11261 10855 10704.0 11510.0 [,11] [,12] [1,] 10719.0 11817 [2,] 10906.0 11876 [3,] 10988.5 12451 [4,] 11475.0 12540 [5,] 11663.0 12686 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 12005.76 10877.47 11562.25 10771.47 11203.57 10395.84 10839.88 10324.56 [2,] 13333.24 12336.53 12560.75 11932.53 11416.43 10873.16 11210.12 10795.44 [,9] [,10] [,11] [,12] [1,] 10230.87 11152.96 10621.48 12022.7 [2,] 10730.13 11558.04 11355.52 12879.3 $out [1] 10670 $group [1] 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(12200, 12487, 12669.5, 13516, 14371, 10644, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/56md61413624065.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,] -1556 -149.0 -1457 -274 -884 319.0 -718 -462 650.0 -478.0 847 -340 [2,] -1556 288.0 -1049 -274 -680 319.0 -473 -297 786.0 -461.0 1023 -45 [3,] -1223 602.5 -818 -149 -623 396.5 -377 -101 830.5 -271.5 1079 670 [4,] -968 1272.0 -706 -38 -540 447.0 -309 14 923.0 153.0 1461 830 [5,] -968 1400.0 -624 300 -416 484.0 -200 217 923.0 190.0 1592 2004 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1602.279 -32.21178 -1039.2461 -301.227623 -713.3045 313.9359 -482.7853 [2,] -843.721 1237.21178 -596.7539 3.227623 -532.6955 479.0641 -271.2147 [,8] [,9] [,10] [,11] [,12] [1,] -301.60504 742.1306 -667.5498 796.4759 51.7272 [2,] 99.60504 918.8694 124.5498 1361.5241 1288.2728 $out [1] -2676 21 -913 -7 1164 $group [1] 1 1 4 6 9 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1556, -1556, -1223, -968, -968, -149, 288, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6gsai1413624065.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,] 10137.0 10239.0 10423.0 10612.0 10704.0 10326.0 NA [2,] 10649.0 10413.5 10802.5 10665.0 11058.5 10921.5 NA [3,] 11160.0 10820.5 11208.5 11288.5 11632.5 11465.5 NA [4,] 11729.5 11620.5 11772.0 11759.5 12500.5 12446.5 NA [5,] 12849.0 11817.0 12540.0 12535.0 12799.0 13811.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 10667.18 10269.98 10766.3 10789.29 10974.79 10769.94 NA [2,] 11652.82 11371.02 11650.7 11787.71 12290.21 12161.06 NA $out [1] 14371 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(10137, 10649, 11160, 11729.5, 12849, 10239, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7a0ds1413624065.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,] 10449.17 10480.50 10455.00 [2,] 10810.17 10811.50 10817.38 [3,] 11290.67 11331.00 11342.50 [4,] 12009.08 11834.25 12064.81 [5,] 12985.50 12669.50 12918.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 10743.83 10864.52 10773.54 [2,] 11837.50 11797.48 11911.46 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(10449.1666666667, 10810.1666666667, 11290.6666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1ysbx1413624065.ps tmp/1ysbx1413624065.png",intern=TRUE)) character(0) > try(system("convert tmp/2rycz1413624065.ps tmp/2rycz1413624065.png",intern=TRUE)) character(0) > try(system("convert tmp/39nq61413624065.ps tmp/39nq61413624065.png",intern=TRUE)) character(0) > try(system("convert tmp/4h94s1413624065.ps tmp/4h94s1413624065.png",intern=TRUE)) character(0) > try(system("convert tmp/56md61413624065.ps tmp/56md61413624065.png",intern=TRUE)) character(0) > try(system("convert tmp/6gsai1413624065.ps tmp/6gsai1413624065.png",intern=TRUE)) character(0) > try(system("convert tmp/7a0ds1413624065.ps tmp/7a0ds1413624065.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.459 0.335 2.835