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(40927,40856,40778,40635,42103,42032,40927,40194,40265,40265,40336,40486,40856,40414,40856,40486,41661,42181,39973,39381,39894,39823,39381,39453,40336,40194,40336,40336,41298,41440,38790,38790,39823,39310,38427,38790,39674,39232,39161,38206,39602,39894,37023,36952,38427,37615,36218,36810,37465,37615,37173,36290,38128,38128,34893,34673,35556,33939,32314,32835,33939,33055,32464,31210,32906,32977,29743,29664,30256,28418,26430,27235,28339,27164,27093,25910,27826,28197,24585,23780,24293,22305,20246,20909,22156,20688,20909,20026,21864,22084,17668,17375,18180,16050,14134,14797,16414,14504,14355,12880,14504,15017,10451,10451,11113,9347,7359,8392,10230,8242,9055,7950,9717,10308,5592,5229,5963,4196,2800,3384) > 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,] 40927 40856 40336 39674 37465 33939 28339 22156 16414 10230 NA [2,] 40856 40414 40194 39232 37615 33055 27164 20688 14504 8242 NA [3,] 40778 40856 40336 39161 37173 32464 27093 20909 14355 9055 NA [4,] 40635 40486 40336 38206 36290 31210 25910 20026 12880 7950 NA [5,] 42103 41661 41298 39602 38128 32906 27826 21864 14504 9717 NA [6,] 42032 42181 41440 39894 38128 32977 28197 22084 15017 10308 NA [7,] 40927 39973 38790 37023 34893 29743 24585 17668 10451 5592 NA [8,] 40194 39381 38790 36952 34673 29664 23780 17375 10451 5229 NA [9,] 40265 39894 39823 38427 35556 30256 24293 18180 11113 5963 NA [10,] 40265 39823 39310 37615 33939 28418 22305 16050 9347 4196 NA [11,] 40336 39381 38427 36218 32314 26430 20246 14134 7359 2800 NA [12,] 40486 39453 38790 36810 32835 27235 20909 14797 8392 3384 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] -71 -442 -142 -442 150 -884 -1175 -1468 -1910 -1988 NA [2,] -78 442 142 -71 -442 -591 -71 221 -149 813 NA [3,] -143 -370 0 -955 -883 -1254 -1183 -883 -1475 -1105 NA [4,] 1468 1175 962 1396 1838 1696 1916 1838 1624 1767 NA [5,] -71 520 142 292 0 71 371 220 513 591 NA [6,] -1105 -2208 -2650 -2871 -3235 -3234 -3612 -4416 -4566 -4716 NA [7,] -733 -592 0 -71 -220 -79 -805 -293 0 -363 NA [8,] 71 513 1033 1475 883 592 513 805 662 734 NA [9,] 0 -71 -513 -812 -1617 -1838 -1988 -2130 -1766 -1767 NA [10,] 71 -442 -883 -1397 -1625 -1988 -2059 -1916 -1988 -1396 NA [11,] 150 72 363 592 521 805 663 663 1033 584 NA [12,] 370 883 884 655 1104 1104 1247 1617 1838 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/10e4v1406623618.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/2fcju1406623618.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/316ma1406623618.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/4oo2y1406623618.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,] 10230 8242 9055.0 7950 9717 10308.0 5592 5229.0 5963 4196.0 2800 [2,] 22156 20688 20909.0 20026 21864 22084.0 17668 17375.0 18180 16050.0 14134 [3,] 35702 35335 34818.5 33750 35517 35552.5 32318 32168.5 32906 31178.5 29372 [4,] 40336 40194 40336.0 40336 41298 41440.0 38790 38790.0 39823 39310.0 38427 [5,] 40927 40856 40856.0 40635 42103 42181.0 40927 40194.0 40265 40265.0 40336 [,12] [1,] 3384 [2,] 14797 [3,] 30035 [4,] 38790 [5,] 40486 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 26618.55 25589.02 25112 23602.31 25807 25881.47 21764.61 21468.71 22092.29 [2,] 44785.45 45080.98 44525 43897.69 45227 45223.53 42871.39 42868.29 43719.71 [,10] [,11] [,12] [1,] 19556.88 17234.25 18047.14 [2,] 42800.12 41509.75 42022.86 $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(10230, 22156, 35702, 40336, 40927, 8242, 20688, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/59pbn1406623618.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,] -1988 -591 -1475 962 -71 -4716.0 -805.0 71 -2130.0 -2059 72 370 [2,] -1468 -149 -1183 1396 71 -4416.0 -592.0 513 -1838.0 -1988 363 883 [3,] -663 -71 -919 1660 256 -3234.5 -256.5 698 -1691.5 -1511 588 1104 [4,] -142 221 -370 1838 513 -2650.0 -71.0 883 -513.0 -883 663 1247 [5,] 150 442 0 1916 591 -1105.0 0.0 1033 0.0 71 1033 1617 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1325.522468 -255.8668 -1325.2072 1439.159 35.15918 -4116.864 -516.812372 [2,] -0.477532 113.8668 -512.7928 1880.841 476.84082 -2352.136 3.812372 [,8] [,9] [,10] [,11] [,12] [1,] 513.1332 -2353.523 -2063.1021 438.108 912.2933 [2,] 882.8668 -1029.477 -958.8979 737.892 1295.7067 $out [1] 813 1475 1838 $group [1] 2 8 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-1988, -1468, -663, -142, 150, -591, -149, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/68t8e1406623618.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] [1,] 40194.0 39381.0 38427.0 36218.0 32314 26430.0 20246.0 14134.0 7359.0 [2,] 40300.5 39638.0 38790.0 36987.5 34306 29041.0 23042.5 16712.5 9899.0 [3,] 40706.5 40193.5 40008.5 38316.5 35923 30733.0 25247.5 19103.0 11996.5 [4,] 40927.0 40856.0 40336.0 39417.0 37540 32941.5 27495.0 21386.5 14504.0 [5,] 40927.0 42181.0 41440.0 39894.0 38128 33939.0 28339.0 22156.0 16414.0 [,10] [,11] [1,] 2800.0 NA [2,] 4712.5 NA [3,] 6956.5 NA [4,] 9386.0 NA [5,] 10308.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 40420.75 39637.96 39303.36 37208.39 34447.95 28953.96 23216.68 16971.16 [2,] 40992.25 40749.04 40713.64 39424.61 37398.05 32512.04 27278.32 21234.84 [,9] [,10] [,11] [1,] 9896.129 4824.885 NA [2,] 14096.871 9088.115 NA $out [1] 42103 42032 $group [1] 1 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(40194, 40300.5, 40706.5, 40927, 40927, 39381, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7mbnf1406623618.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,] 25764.50 29372.0 26768.38 [2,] 27387.85 31673.5 28451.69 [3,] 28884.95 33328.0 30120.69 [4,] 30589.45 35426.0 31592.38 [5,] 31225.80 35702.0 32332.88 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 27424.68 31616.46 28688.20 [2,] 30345.22 35039.54 31553.18 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(25764.5, 27387.85, 28884.95, 30589.45, 31225.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/10e4v1406623618.ps tmp/10e4v1406623618.png",intern=TRUE)) character(0) > try(system("convert tmp/2fcju1406623618.ps tmp/2fcju1406623618.png",intern=TRUE)) character(0) > try(system("convert tmp/316ma1406623618.ps tmp/316ma1406623618.png",intern=TRUE)) character(0) > try(system("convert tmp/4oo2y1406623618.ps tmp/4oo2y1406623618.png",intern=TRUE)) character(0) > try(system("convert tmp/59pbn1406623618.ps tmp/59pbn1406623618.png",intern=TRUE)) character(0) > try(system("convert tmp/68t8e1406623618.ps tmp/68t8e1406623618.png",intern=TRUE)) character(0) > try(system("convert tmp/7mbnf1406623618.ps tmp/7mbnf1406623618.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.532 0.399 2.961