R version 3.0.1 (2013-05-16) -- "Good Sport" Copyright (C) 2013 The R Foundation for Statistical Computing 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(69731,68504,67277,64823,89654,88427,69731,57316,58542,58542,59770,62357,54862,47354,41207,41207,64823,67277,48581,27431,38620,38620,47354,52396,51168,38620,44900,42434,63584,58542,38620,23738,37392,41207,44900,49808,39846,31246,34939,36166,68504,68504,49808,47354,54862,51168,61130,73546,76012,58542,53622,48581,82280,84746,78466,84746,83507,73546,84746,97162,102203,87200,77238,84746,117084,127046,124592,129499,128273,115858,137008,142049,149423,127046,118312,128273,152010,173160,168119,168119,170585,161971,184361,184361,180546,159384,163199,165665,181895,203045,188041,195550,189269,185587,214246,207965,199230,186815,199230,205511,213006,222967,213006,219154,211657,210431,241542,244129,234168,216700,231581,237850,245357,256546,245357,254092,250277,236622,265279,265279) > 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,] 69731 54862 51168 39846 76012 102203 149423 180546 199230 234168 NA [2,] 68504 47354 38620 31246 58542 87200 127046 159384 186815 216700 NA [3,] 67277 41207 44900 34939 53622 77238 118312 163199 199230 231581 NA [4,] 64823 41207 42434 36166 48581 84746 128273 165665 205511 237850 NA [5,] 89654 64823 63584 68504 82280 117084 152010 181895 213006 245357 NA [6,] 88427 67277 58542 68504 84746 127046 173160 203045 222967 256546 NA [7,] 69731 48581 38620 49808 78466 124592 168119 188041 213006 245357 NA [8,] 57316 27431 23738 47354 84746 129499 168119 195550 219154 254092 NA [9,] 58542 38620 37392 54862 83507 128273 170585 189269 211657 250277 NA [10,] 58542 38620 41207 51168 73546 115858 161971 185587 210431 236622 NA [11,] 59770 47354 44900 61130 84746 137008 184361 214246 241542 265279 NA [12,] 62357 52396 49808 73546 97162 142049 184361 207965 244129 265279 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -1227 -7508 -12548 -8600 -17470 -15003 -22377 -21162 -12415 -17468 [2,] -1227 -6147 6280 3693 -4920 -9962 -8734 3815 12415 14881 [3,] -2454 0 -2466 1227 -5041 7508 9961 2466 6281 6269 [4,] 24831 23616 21150 32338 33699 32338 23737 16230 7495 7507 [5,] -1227 2454 -5042 0 2466 9962 21150 21150 9961 11189 [6,] -18696 -18696 -19922 -18696 -6280 -2454 -5041 -15004 -9961 -11189 [7,] -12415 -21150 -14882 -2454 6280 4907 0 7509 6148 8735 [8,] 1226 11189 13654 7508 -1239 -1226 2466 -6281 -7497 -3815 [9,] 0 0 3815 -3694 -9961 -12415 -8614 -3682 -1226 -13655 [10,] 1228 8734 3693 9962 11200 21150 22390 28659 31111 28657 [11,] 2587 5042 4908 12416 12416 5041 0 -6281 2587 0 [12,] -7495 -1228 -9962 2466 5041 7374 -3815 -8735 -9961 NA [,11] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] 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/1kwnj1375359448.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/2yc6e1375359448.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/3vj1z1375359448.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/45o171375359448.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] [1,] 39846.0 31246 34939.0 36166.0 63584 58542.0 38620 23738.0 37392 [2,] 54862.0 47354 44900.0 42434.0 68504 68504.0 49808 47354.0 54862 [3,] 89107.5 77852 72257.5 74784.5 103369 107736.5 101529 107122.5 105890 [4,] 180546.0 159384 163199.0 165665.0 181895 203045.0 188041 195550.0 189269 [5,] 234168.0 216700 231581.0 237850.0 245357 256546.0 245357 254092.0 250277 [,10] [,11] [,12] [1,] 38620 44900 49808.0 [2,] 51168 59770 62357.0 [3,] 94702 110877 119605.5 [4,] 185587 214246 207965.0 [5,] 236622 265279 265279.0 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 26310.76 21877.35 13150.6 13213.38 46714.34 40514.45 32462.28 [2,] 151904.24 133826.65 131364.4 136355.62 160023.66 174958.55 170595.72 [,8] [,9] [,10] [,11] [,12] [1,] 33077.87 38734.9 27540.91 33694.63 46853.94 [2,] 181167.13 173045.1 161863.09 188059.37 192357.06 $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(39846, 54862, 89107.5, 180546, 234168, 31246, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5292t1375359448.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] [1,] -22377.0 -9962 -5041.0 7495.0 -5042.0 -19922.0 -21150.0 -7497 -13655 [2,] -17470.0 -6147 -2454.0 16230.0 0.0 -18696.0 -12415.0 -3815 -9961 [3,] -13775.5 1233 1846.5 23676.5 6213.5 -13096.5 2453.5 0 -3688 [4,] -8600.0 6280 6281.0 32338.0 11189.0 -6280.0 6280.0 7508 0 [5,] -1227.0 14881 9961.0 33699.0 21150.0 -2454.0 8735.0 13654 3815 [,10] [,11] [,12] [1,] 1228 -6281.0 -9962 [2,] 8734 0.0 -8735 [3,] 16175 3747.5 -3815 [4,] 28657 5042.0 2466 [5,] 31111 12416.0 7374 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -18207.306 -4976.025 -2517.854 15628.3 623.0295 -19300.029 -6887.267 [2,] -9343.694 7442.025 6210.854 31724.7 11803.9705 -6892.971 11794.267 [,8] [,9] [,10] [,11] [,12] [1,] -5657.422 -8664.913 6220.675 1228.316 -9714.193 [2,] 5657.422 1288.913 26129.325 6266.684 2084.193 $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(-22377, -17470, -13775.5, -8600, -1227, -9962, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6rtbs1375359448.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,] 57316 27431.0 23738 31246 48581 77238.0 118312.0 159384.0 186815.0 216700 [2,] 59156 39913.5 38620 38006 66044 94701.5 138848.0 173105.5 202370.5 235395 [3,] 66050 47354.0 43667 50488 80373 120838.0 165045.0 186814.0 212331.5 245357 [4,] 69731 53629.0 50488 64817 84746 128886.0 171872.5 199297.5 221060.5 255319 [5,] 69731 67277.0 63584 73546 97162 142049.0 184361.0 214246.0 244129.0 265279 [,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,] 61226.67 41098.27 38253.93 38259.32 71842.89 105246.2 149982.3 174867.7 [2,] 70873.33 53609.73 49080.07 62716.68 88903.11 136429.8 180107.7 198760.3 [,9] [,10] [,11] [1,] 203806.9 236269.5 NA [2,] 220856.1 254444.5 NA $out [1] 89654 88427 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(57316, 59156, 66050, 69731, 69731, 27431, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/77ova1375359448.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,] 102141.1 72257.50 99528.88 [2,] 110622.2 83479.75 108198.75 [3,] 121499.1 102449.00 119096.50 [4,] 130926.6 107429.50 128314.12 [5,] 137905.2 119605.50 134069.12 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 112238.2 91525.36 109921.7 [2,] 130760.1 113372.64 128271.3 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(102141.1, 110622.25, 121499.15, 130926.65, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1kwnj1375359448.ps tmp/1kwnj1375359448.png",intern=TRUE)) character(0) > try(system("convert tmp/2yc6e1375359448.ps tmp/2yc6e1375359448.png",intern=TRUE)) character(0) > try(system("convert tmp/3vj1z1375359448.ps tmp/3vj1z1375359448.png",intern=TRUE)) character(0) > try(system("convert tmp/45o171375359448.ps tmp/45o171375359448.png",intern=TRUE)) character(0) > try(system("convert tmp/5292t1375359448.ps tmp/5292t1375359448.png",intern=TRUE)) character(0) > try(system("convert tmp/6rtbs1375359448.ps tmp/6rtbs1375359448.png",intern=TRUE)) character(0) > try(system("convert tmp/77ova1375359448.ps tmp/77ova1375359448.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.297 1.167 6.645