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(11236,10954,9580,10337,8961,10372,12782,15119,19940,13957,10849,9429,11816,11329,11334,9898,8961,10783,13149,16244,20067,13601,10573,8623,10962,11911,11677,9679,9116,11394,13240,18983,21545,14360,11839,9726,12347,12624,11918,10028,10228,11026,13878,22165,23533,13445,12164,9606,12177,13142,11210,9485,10082,10680,13579,21709,22205,14687,11222,8196,12794,12627,11080,10425,10865,10771,14771,20993,23882,14825,11648,10091) > 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,] 11236 11816 10962 12347 12177 12794 NA [2,] 10954 11329 11911 12624 13142 12627 NA [3,] 9580 11334 11677 11918 11210 11080 NA [4,] 10337 9898 9679 10028 9485 10425 NA [5,] 8961 8961 9116 10228 10082 10865 NA [6,] 10372 10783 11394 11026 10680 10771 NA [7,] 12782 13149 13240 13878 13579 14771 NA [8,] 15119 16244 18983 22165 21709 20993 NA [9,] 19940 20067 21545 23533 22205 23882 NA [10,] 13957 13601 14360 13445 14687 14825 NA [11,] 10849 10573 11839 12164 11222 11648 NA [12,] 9429 8623 9726 9606 8196 10091 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -282 -487 949 277 965 -167 NA [2,] -1374 5 -234 -706 -1932 -1547 NA [3,] 757 -1436 -1998 -1890 -1725 -655 NA [4,] -1376 -937 -563 200 597 440 NA [5,] 1411 1822 2278 798 598 -94 NA [6,] 2410 2366 1846 2852 2899 4000 NA [7,] 2337 3095 5743 8287 8130 6222 NA [8,] 4821 3823 2562 1368 496 2889 NA [9,] -5983 -6466 -7185 -10088 -7518 -9057 NA [10,] -3108 -3028 -2521 -1281 -3465 -3177 NA [11,] -1420 -1950 -2113 -2558 -3026 -1557 NA [12,] 2387 2339 2621 2571 4598 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/1du081413131596.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/2icyw1413131596.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/3zo451413131596.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/4ij1m1413131596.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] [,11] [1,] 10962.0 10954.0 11080 9485 8961 10372 12782.0 15119 19940 13445.0 10573 [2,] 11236.0 11329.0 11080 9679 8961 10680 13149.0 16244 20067 13601.0 10849 [3,] 11996.5 12267.5 11272 9963 9599 10777 13409.5 19988 21875 14158.5 11435 [4,] 12347.0 12627.0 11677 10337 10228 11026 13878.0 21709 23533 14687.0 11839 [5,] 12794.0 13142.0 11918 10425 10865 11394 14771.0 22165 23882 14825.0 12164 [,12] [1,] 8196.0 [2,] 8623.0 [3,] 9517.5 [4,] 9726.0 [5,] 10091.0 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 11279.87 11430.25 10886.92 9538.569 8781.744 10553.82 12939.27 16462.9 [2,] 12713.13 13104.75 11657.08 10387.431 10416.256 11000.18 13879.73 23513.1 [,9] [,10] [,11] [,12] [1,] 19639.32 13457.99 10796.42 8806.029 [2,] 24110.68 14859.01 12073.58 10228.971 $out [1] 9580 $group [1] 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(10962, 11236, 11996.5, 12347, 12794, 10954, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5pzki1413131596.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] [1,] -487 -1932 -1998.0 -1376.0 -94.0 1846 2337.0 496.0 -10088.0 -3465 [2,] -282 -1547 -1890.0 -937.0 598.0 2366 3095.0 1368.0 -9057.0 -3177 [3,] 55 -1040 -1580.5 -181.5 1104.5 2631 5982.5 2725.5 -7351.5 -3068 [4,] 949 -234 -655.0 440.0 1822.0 2899 8130.0 3823.0 -6466.0 -2521 [5,] 965 5 757.0 597.0 2278.0 2899 8287.0 4821.0 -5983.0 -2521 [,11] [,12] [1,] -3026.0 2339 [2,] -2558.0 2387 [3,] -2031.5 2571 [4,] -1557.0 2621 [5,] -1420.0 2621 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -739.0348 -1886.9274 -2377.1149 -1069.7095 314.9805 2287.198 2734.762 [2,] 849.0348 -193.0726 -783.8851 706.7095 1894.0195 2974.802 9230.238 [,8] [,9] [,10] [,11] [,12] [1,] 1141.946 -9022.779 -3491.141 -2677.177 2405.656 [2,] 4309.054 -5680.221 -2644.859 -1385.823 2736.344 $out [1] 4000 -1281 4598 $group [1] 6 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-487, -282, 55, 949, 965, -1932, -1547, -1040, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6sev61413131596.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,] 8961.0 8623.0 9116 9606.0 8196.0 10091.0 NA [2,] 9958.5 10235.5 10344 10627.0 10381.0 10818.0 NA [3,] 10901.5 11331.5 11758 12255.5 11699.5 12137.5 NA [4,] 13369.5 13375.0 13800 13661.5 14133.0 14798.0 NA [5,] 15119.0 16244.0 18983 13878.0 14687.0 14825.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 9345.72 9899.553 10181.7 10871.44 9988.188 10322.2 NA [2,] 12457.28 12763.447 13334.3 13639.56 13410.812 13952.8 NA $out [1] 19940 20067 21545 22165 23533 21709 22205 20993 23882 $group [1] 1 2 3 4 4 5 5 6 6 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(8961, 9958.5, 10901.5, 13369.5, 15119, 8623, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7k5ay1413131596.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,] 9278.50 9517.50 9260.25 [2,] 10406.50 10370.00 10415.38 [3,] 11635.58 11715.75 11604.75 [4,] 13856.17 13784.00 13817.56 [5,] 14145.83 14158.50 14147.62 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 10062.17 10158.6 10052.99 [2,] 13209.00 13272.9 13156.51 $out [1] 19202.17 21862.00 19988.00 21875.00 19229.38 21818.75 $group [1] 1 1 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(9278.5, 10406.5, 11635.5833333333, 13856.1666666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1du081413131596.ps tmp/1du081413131596.png",intern=TRUE)) character(0) > try(system("convert tmp/2icyw1413131596.ps tmp/2icyw1413131596.png",intern=TRUE)) character(0) > try(system("convert tmp/3zo451413131596.ps tmp/3zo451413131596.png",intern=TRUE)) character(0) > try(system("convert tmp/4ij1m1413131596.ps tmp/4ij1m1413131596.png",intern=TRUE)) character(0) > try(system("convert tmp/5pzki1413131596.ps tmp/5pzki1413131596.png",intern=TRUE)) character(0) > try(system("convert tmp/6sev61413131596.ps tmp/6sev61413131596.png",intern=TRUE)) character(0) > try(system("convert tmp/7k5ay1413131596.ps tmp/7k5ay1413131596.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.355 0.472 2.849