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(10407,10463,10556,10646,10702,11353,11346,11451,11964,12574,13031,13812,14544,14931,14886,16005,17064,15168,16050,15839,15137,14954,15648,15305,15579,16348,15928,16171,15937,15713,15594,15683,16438,17032,17696,17745,19394,20148,20108,18584,18441,18391,19178,18079,18483,19644,19195,19650,20830,23595,22937,21814,21928,21777,21383,21467,22052,22680,24320,24977,25204,25739,26434,27525,30695,32436,30160,30236,31293,31077,32226,33865,32810,32242,32700,32819,33947,34148,35261,39506,41591,39148,41216,40225,41126,42362,40740,40256,39804,41002,41702,42254,43605,43271,43221,41373,40435,39217,39457,36710,34977,32729,31584,32510,32565,30988,30383,28673,29358,30580,31110,30241,30276,30266,31174,31282,30926,31040,30308,31321) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] 10 10 10 10 10 10 10 10 10 10 10 10 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 10407 14544 15579 19394 20830 25204 32810 41126 40435 29358 NA [2,] 10463 14931 16348 20148 23595 25739 32242 42362 39217 30580 NA [3,] 10556 14886 15928 20108 22937 26434 32700 40740 39457 31110 NA [4,] 10646 16005 16171 18584 21814 27525 32819 40256 36710 30241 NA [5,] 10702 17064 15937 18441 21928 30695 33947 39804 34977 30276 NA [6,] 11353 15168 15713 18391 21777 32436 34148 41002 32729 30266 NA [7,] 11346 16050 15594 19178 21383 30160 35261 41702 31584 31174 NA [8,] 11451 15839 15683 18079 21467 30236 39506 42254 32510 31282 NA [9,] 11964 15137 16438 18483 22052 31293 41591 43605 32565 30926 NA [10,] 12574 14954 17032 19644 22680 31077 39148 43271 30988 31040 NA [11,] 13031 15648 17696 19195 24320 32226 41216 43221 30383 30308 NA [12,] 13812 15305 17745 19650 24977 33865 40225 41373 28673 31321 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] 56 387 769 754 2765 535 -568 1236 -1218 1222 NA [2,] 93 -45 -420 -40 -658 695 458 -1622 240 530 NA [3,] 90 1119 243 -1524 -1123 1091 119 -484 -2747 -869 NA [4,] 56 1059 -234 -143 114 3170 1128 -452 -1733 35 NA [5,] 651 -1896 -224 -50 -151 1741 201 1198 -2248 -10 NA [6,] -7 882 -119 787 -394 -2276 1113 700 -1145 908 NA [7,] 105 -211 89 -1099 84 76 4245 552 926 108 NA [8,] 513 -702 755 404 585 1057 2085 1351 55 -356 NA [9,] 610 -183 594 1161 628 -216 -2443 -334 -1577 114 NA [10,] 457 694 664 -449 1640 1149 2068 -50 -605 -732 NA [11,] 781 -343 49 455 657 1639 -991 -1848 -1710 1013 NA [12,] 732 274 1649 1180 227 -1055 901 -938 685 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/1j3pj1425595738.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/2drm71425595738.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/3k8lb1425595738.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/4vdpm1425595738.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,] 10407 10463 10556.0 10646.0 10702 11353.0 11346.0 11451.0 11964 12574 [2,] 15579 16348 15928.0 16171.0 17064 15713.0 16050.0 15839.0 16438 17032 [3,] 23017 24667 24685.5 24669.5 26102 26021.5 25771.5 25851.5 26489 26834 [4,] 32810 32242 32700.0 32819.0 33947 32729.0 31584.0 32510.0 32565 31077 [5,] 41126 42362 40740.0 40256.0 39804 41002.0 41702.0 42254.0 43605 43271 [,11] [,12] [1,] 13031 13812 [2,] 17696 17745 [3,] 27314 26825 [4,] 32226 33865 [5,] 43221 41373 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 14407.71 16725.72 16305.54 16351.5 17666.58 17519.63 18010.09 17522 [2,] 31626.29 32608.28 33065.46 32987.5 34537.42 34523.37 33532.91 34181 [,9] [,10] [,11] [,12] [1,] 18431.31 19816.56 20054.23 18770.81 [2,] 34546.69 33851.44 34573.77 34879.19 $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(10407, 15579, 23017, 32810, 41126, 10463, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5xmn21425595738.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,] -1218.0 -1622.0 -2747 -1733.0 -224 -2276.0 -211 -702 -1577.0 -732.0 -1848 [2,] 56.0 -420.0 -1123 -234.0 -224 -394.0 76 55 -334.0 -449.0 -991 [3,] 644.5 26.5 -197 45.5 -30 346.5 97 549 -34.5 560.5 252 [4,] 1222.0 458.0 243 1059.0 651 882.0 552 1057 610.0 1149.0 781 [5,] 2765.0 695.0 1119 1128.0 1741 1113.0 926 2085 1161.0 2068.0 1639 [,12] [1,] 227 [2,] 227 [3,] 685 [4,] 901 [5,] 1649 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 61.91991 -412.1838 -879.5081 -600.5344 -467.1849 -291.0405 -140.8286 [2,] 1227.08009 465.1838 485.5081 691.5344 407.1849 984.0405 334.8286 [,8] [,9] [,10] [,11] [,12] [1,] 48.36085 -506.16 -237.9245 -633.3619 330.0267 [2,] 1049.63915 437.16 1358.9245 1137.3619 1039.9733 $out [1] 3170 -1896 -2248 -1099 4245 -2443 -1055 -938 $group [1] 4 5 5 7 7 9 12 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1218, 56, 644.5, 1222, 2765, -1622, -420, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6fxia1425595738.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] [,8] [,9] [,10] [1,] 10407.0 14544.0 15579 18079.0 20830 25204.0 32242.0 39804.0 28673.0 29358 [2,] 10601.0 14942.5 15698 18462.0 21622 26979.5 32814.5 40871.0 31286.0 30271 [3,] 11349.5 15236.5 16054 19186.5 21990 30465.5 34704.5 41537.5 32647.0 30753 [4,] 12269.0 15922.0 16735 19647.0 23266 31759.5 39865.5 42791.5 37963.5 31142 [5,] 13812.0 17064.0 17745 20148.0 24977 33865.0 41591.0 43605.0 40435.0 31321 [,11] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 10588.71 14789.74 15581.02 18646.01 21240.16 28285.31 31488.49 40661.55 [2,] 12110.29 15683.26 16526.98 19726.99 22739.84 32645.69 37920.51 42413.45 [,9] [,10] [,11] [1,] 29601.35 30355.73 NA [2,] 35692.65 31150.27 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(10407, 10601, 11349.5, 12269, 13812, 14544, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7x8sr1425595738.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,] 24968.70 23017.0 24156.75 [2,] 25320.75 24677.5 24338.69 [3,] 25524.05 25936.5 24540.69 [4,] 26323.10 26657.0 24777.88 [5,] 26724.40 27314.0 25271.12 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 25066.87 25033.64 24340.37 [2,] 25981.23 26839.36 24741.00 $out [1] 25725.12 $group [1] 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(24968.7, 25320.75, 25524.05, 26323.1, 26724.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1j3pj1425595738.ps tmp/1j3pj1425595738.png",intern=TRUE)) character(0) > try(system("convert tmp/2drm71425595738.ps tmp/2drm71425595738.png",intern=TRUE)) character(0) > try(system("convert tmp/3k8lb1425595738.ps tmp/3k8lb1425595738.png",intern=TRUE)) character(0) > try(system("convert tmp/4vdpm1425595738.ps tmp/4vdpm1425595738.png",intern=TRUE)) character(0) > try(system("convert tmp/5xmn21425595738.ps tmp/5xmn21425595738.png",intern=TRUE)) character(0) > try(system("convert tmp/6fxia1425595738.ps tmp/6fxia1425595738.png",intern=TRUE)) character(0) > try(system("convert tmp/7x8sr1425595738.ps tmp/7x8sr1425595738.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.492 0.455 2.969