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(6900,7045,8044,8196,8257,8623,8644,8648,8961,8961,9116,9313,9360,9429,9485,9580,9606,9679,9726,9898,10028,10082,10091,10228,10337,10372,10425,10573,10680,10685,10771,10783,10849,10865,10954,10962,11026,11080,11210,11222,11236,11329,11334,11394,11648,11677,11816,11839,11874,11911,11918,12164,12177,12347,12624,12627,12782,12794,13142,13149,13240,13270,13445,13579,13601,13878,13957,14360,14687,14771,14779,14825,15119,16244,18983,19940,20067,20993,21545,21709,22165,22205,23533,23882,59646) > 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] 85 > (np <- floor(n / par1)) [1] 7 > 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] 8 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 6900 9360 10337 11026 11874 13240 15119 59646 [2,] 7045 9429 10372 11080 11911 13270 16244 NA [3,] 8044 9485 10425 11210 11918 13445 18983 NA [4,] 8196 9580 10573 11222 12164 13579 19940 NA [5,] 8257 9606 10680 11236 12177 13601 20067 NA [6,] 8623 9679 10685 11329 12347 13878 20993 NA [7,] 8644 9726 10771 11334 12624 13957 21545 NA [8,] 8648 9898 10783 11394 12627 14360 21709 NA [9,] 8961 10028 10849 11648 12782 14687 22165 NA [10,] 8961 10082 10865 11677 12794 14771 22205 NA [11,] 9116 10091 10954 11816 13142 14779 23533 NA [12,] 9313 10228 10962 11839 13149 14825 23882 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 145 69 35 54 37 30 1125 NA [2,] 999 56 53 130 7 175 2739 NA [3,] 152 95 148 12 246 134 957 NA [4,] 61 26 107 14 13 22 127 NA [5,] 366 73 5 93 170 277 926 NA [6,] 21 47 86 5 277 79 552 NA [7,] 4 172 12 60 3 403 164 NA [8,] 313 130 66 254 155 327 456 NA [9,] 0 54 16 29 12 84 40 NA [10,] 155 9 89 139 348 8 1328 NA [11,] 197 137 8 23 7 46 349 NA [12,] 47 109 64 35 91 294 35764 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/1raow1413720915.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/2r4kd1413720915.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/3ylct1413720915.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/4715o1413720915.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,] 6900.0 7045.0 8044.0 8196.0 8257 8623.0 8644.0 8648.0 8961.0 [2,] 9848.5 9900.5 9955.0 10076.5 10143 10182.0 10248.5 10340.5 10438.5 [3,] 11450.0 11080.0 11210.0 11222.0 11236 11329.0 11334.0 11394.0 11648.0 [4,] 14179.5 12590.5 12681.5 12871.5 12889 13112.5 13290.5 13493.5 13734.5 [5,] 15119.0 16244.0 13445.0 13579.0 13601 13878.0 13957.0 14360.0 14687.0 [,10] [,11] [,12] [1,] 8961.0 9116.0 9313 [2,] 10473.5 10522.5 10595 [3,] 11677.0 11816.0 11839 [4,] 13782.5 13960.5 13987 [5,] 14771.0 14779.0 14825 $n [1] 8 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 9030.641 9473.575 9581.778 9552.871 9596.133 9578.953 9517.367 [2,] 13869.359 12686.425 12838.222 12891.129 12875.867 13079.047 13150.633 [,8] [,9] [,10] [,11] [,12] [1,] 9511.079 9679.682 9700.919 9762.882 9813.352 [2,] 13276.921 13616.318 13653.081 13869.118 13864.648 $out [1] 59646 18983 19940 20067 20993 21545 21709 22165 22205 23533 23882 $group [1] 1 3 4 5 6 7 8 9 10 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(6900, 9848.5, 11450, 14179.5, 15119, 7045, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5fkwl1413720915.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,] 30 7.0 12.0 13 5.0 5.0 3 66.0 0 8.0 7.0 35.0 [2,] 36 54.5 114.5 18 83.0 34.0 8 142.5 14 49.0 15.5 55.5 [3,] 54 130.0 148.0 26 170.0 79.0 60 254.0 29 139.0 46.0 91.0 [4,] 107 587.0 199.0 84 321.5 181.5 168 320.0 47 251.5 167.0 201.5 [5,] 145 999.0 246.0 127 366.0 277.0 403 456.0 84 348.0 349.0 294.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 11.59995 -188.0004 97.53796 -13.41414 27.57165 -9.08462 -35.54942 [2,] 96.40005 448.0004 198.46204 65.41414 312.42835 167.08462 155.54942 [,8] [,9] [,10] [,11] [,12] [1,] 147.9999 9.292932 18.07027 -44.47336 3.811155 [2,] 360.0001 48.707068 259.92973 136.47336 178.188845 $out [1] 1125 2739 957 926 552 1328 35764 $group [1] 1 2 3 5 6 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(30, 36, 54, 107, 145, 7, 54.5, 130, 587, 999, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6l57c1413720915.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] [1,] 6900.0 9360.0 10337 11026.0 11874.0 13240.0 16244.0 59646 [2,] 8120.0 9532.5 10499 11216.0 12041.0 13512.0 19461.5 59646 [3,] 8633.5 9702.5 10728 11331.5 12485.5 13917.5 21269.0 59646 [4,] 8961.0 10055.0 10857 11662.5 12788.0 14729.0 22185.0 59646 [5,] 9313.0 10228.0 10962 11839.0 13149.0 14825.0 23882.0 59646 $n [1] 12 12 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 8249.914 9464.184 10564.71 11127.85 12144.79 13362.42 20026.79 59646 [2,] 9017.086 9940.816 10891.29 11535.15 12826.21 14472.58 22511.21 59646 $out [1] 15119 $group [1] 7 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(6900, 8120, 8633.5, 8961, 9313, 9360, 9532.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7f4v21413720915.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,] 11335.86 11080.0 11245.50 [2,] 12205.57 11229.0 11495.00 [3,] 12715.71 11364.0 11835.38 [4,] 13199.00 11662.5 12107.25 [5,] 13456.86 11839.0 12291.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 12262.60 11166.28 11556.12 [2,] 13168.82 11561.72 12114.63 $out [1] 17187.75 $group [1] 1 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(11335.8571428571, 12205.5714285714, 12715.7142857143, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1raow1413720915.ps tmp/1raow1413720915.png",intern=TRUE)) character(0) > try(system("convert tmp/2r4kd1413720915.ps tmp/2r4kd1413720915.png",intern=TRUE)) character(0) > try(system("convert tmp/3ylct1413720915.ps tmp/3ylct1413720915.png",intern=TRUE)) character(0) > try(system("convert tmp/4715o1413720915.ps tmp/4715o1413720915.png",intern=TRUE)) character(0) > try(system("convert tmp/5fkwl1413720915.ps tmp/5fkwl1413720915.png",intern=TRUE)) character(0) > try(system("convert tmp/6l57c1413720915.ps tmp/6l57c1413720915.png",intern=TRUE)) character(0) > try(system("convert tmp/7f4v21413720915.ps tmp/7f4v21413720915.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.412 0.395 2.839