R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" 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(58608,46865,51378,46235,47206,45382,41227,33795,31295,42625,33625,21538,56421,53152,53536,52408,41454,38271,35306,26414,31917,38030,27534,18387,50556,43901,48572,43899,37532,40357,35489,29027,34485,42598,30306,26451,47460,50104,61465,53726,39477,43895,31481,29896,33842,39120,33702,25094,51442,45594,52518,48564,41745,49585,32747,33379,35645,37034,35681,20972,58552,54955,65540,51570,51145,46641,35704,33253,35193,41668,34865,21210,56126,49231,59723,48103,47472,50497,40059,34149,36860,46356,36577,23872,57276,56389,57657,62300,48929,51168,39636,33213,38127,43291,30600,21956,48033,46148,50736,48114,38390,44112,36287,30333,35908,40005,35263,26591,49771,47882,64830,57846,48188,54400,39778,37772,37214,43829,40701,29450,53597,53588,64172,53955,55509,48908,35331,38073,41776,42717,40736,49020,45099,44114,60487,48760,41281,48346,37025,31514,33977,42060,36036,22012) > 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] 144 > (np <- floor(n / par1)) [1] 12 > 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] 12 12 12 12 12 12 12 12 12 12 12 12 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 58608 56421 50556 47460 51442 58552 56126 57276 48033 49771 53597 45099 [2,] 46865 53152 43901 50104 45594 54955 49231 56389 46148 47882 53588 44114 [3,] 51378 53536 48572 61465 52518 65540 59723 57657 50736 64830 64172 60487 [4,] 46235 52408 43899 53726 48564 51570 48103 62300 48114 57846 53955 48760 [5,] 47206 41454 37532 39477 41745 51145 47472 48929 38390 48188 55509 41281 [6,] 45382 38271 40357 43895 49585 46641 50497 51168 44112 54400 48908 48346 [7,] 41227 35306 35489 31481 32747 35704 40059 39636 36287 39778 35331 37025 [8,] 33795 26414 29027 29896 33379 33253 34149 33213 30333 37772 38073 31514 [9,] 31295 31917 34485 33842 35645 35193 36860 38127 35908 37214 41776 33977 [10,] 42625 38030 42598 39120 37034 41668 46356 43291 40005 43829 42717 42060 [11,] 33625 27534 30306 33702 35681 34865 36577 30600 35263 40701 40736 36036 [12,] 21538 18387 26451 25094 20972 21210 23872 21956 26591 29450 49020 22012 [,13] [1,] NA [2,] NA [3,] NA [4,] NA [5,] NA [6,] NA [7,] NA [8,] NA [9,] NA [10,] NA [11,] NA [12,] NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -11743 -3269 -6655 2644 -5848 -3597 -6895 -887 -1885 -1889 [2,] 4513 384 4671 11361 6924 10585 10492 1268 4588 16948 [3,] -5143 -1128 -4673 -7739 -3954 -13970 -11620 4643 -2622 -6984 [4,] 971 -10954 -6367 -14249 -6819 -425 -631 -13371 -9724 -9658 [5,] -1824 -3183 2825 4418 7840 -4504 3025 2239 5722 6212 [6,] -4155 -2965 -4868 -12414 -16838 -10937 -10438 -11532 -7825 -14622 [7,] -7432 -8892 -6462 -1585 632 -2451 -5910 -6423 -5954 -2006 [8,] -2500 5503 5458 3946 2266 1940 2711 4914 5575 -558 [9,] 11330 6113 8113 5278 1389 6475 9496 5164 4097 6615 [10,] -9000 -10496 -12292 -5418 -1353 -6803 -9779 -12691 -4742 -3128 [11,] -12087 -9147 -3855 -8608 -14709 -13655 -12705 -8644 -8672 -11251 [12,] 34883 32169 21009 26348 37580 34916 33404 26077 23180 24147 [,11] [,12] [,13] [1,] -9 -985 NA [2,] 10584 16373 NA [3,] -10217 -11727 NA [4,] 1554 -7479 NA [5,] -6601 7065 NA [6,] -13577 -11321 NA [7,] 2742 -5511 NA [8,] 3703 2463 NA [9,] 941 8083 NA [10,] -1981 -6024 NA [11,] 8284 -14024 NA [12,] -3921 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/1vaez1381945996.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/2qaqx1381945996.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/373ca1381945996.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/4l49t1381945996.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,] 45099.0 43901.0 48572.0 43899.0 37532.0 38271.0 31481.0 26414.0 31295.0 [2,] 48902.0 45871.0 51948.0 48108.5 40379.0 44003.5 35318.5 30114.5 33909.5 [3,] 52519.5 48556.5 58690.0 50165.0 44475.5 47493.5 35995.5 33233.0 35419.0 [4,] 56848.5 53370.0 62818.5 53840.5 48558.5 50041.0 39707.0 33972.0 37037.0 [5,] 58608.0 56389.0 65540.0 62300.0 55509.0 54400.0 41227.0 38073.0 38127.0 [,10] [,11] [,12] [1,] 37034.0 27534.0 18387 [2,] 39562.5 32112.5 21374 [3,] 42329.0 35064.0 22942 [4,] 43004.0 36306.5 26521 [5,] 46356.0 40736.0 29450 $n [1] 12 12 12 12 12 12 12 12 12 12 12 12 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 48895.05 45136.16 53731.89 47550.6 40744.78 44739.76 33993.88 31473.57 [2,] 56143.95 51976.84 63648.11 52779.4 48206.22 50247.24 37997.12 34992.43 [,9] [,10] [,11] [,12] [1,] 33992.53 40759.31 33151.09 20594.42 [2,] 36845.47 43898.69 36976.91 25289.58 $out [1] 41776 49020 $group [1] 9 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(45099, 48902, 52519.5, 56848.5, 58608, 43901, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5izf11381945996.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,] -11743.0 384.0 -13970.0 -14249 -6601.0 -16838.0 -8892.0 -2500 941.0 [2,] -6251.5 4550.5 -10918.5 -10339 -2503.5 -12995.5 -6442.5 2103 4630.5 [3,] -2579.0 8708.0 -6063.5 -7149 2925.0 -11129.0 -5710.5 3207 6294.0 [4,] -936.0 10973.0 -3288.0 -528 5967.0 -6346.5 -1795.5 5186 8098.0 [5,] 2644.0 16948.0 4643.0 1554 7840.0 -2965.0 2742.0 5575 11330.0 [,10] [,11] [,12] [1,] -12691.0 -14709 21009.0 [2,] -10137.5 -13180 23663.5 [3,] -6413.5 -10199 26348.0 [4,] -3935.0 -8626 34143.5 [5,] -1353.0 -3855 37580.0 $n [1] 12 12 12 12 12 12 12 12 12 12 12 11 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -5003.4352 5778.655 -9543.822 -11623.863 -938.4519 -14161.654 -7830.028 [2,] -154.5648 11637.345 -2583.178 -2674.137 6788.4519 -8096.346 -3590.972 [,8] [,9] [,10] [,11] [,12] [1,] 1800.823 4712.45 -9242.502 -12276.11 21355.45 [2,] 4613.177 7875.55 -3584.498 -8121.89 31340.55 $out [1] 8284 -3921 $group [1] 11 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-11743, -6251.5, -2579, -936, 2644, 384, 4550.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/647lo1381945996.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,] 21538.0 18387.0 26451.0 25094.0 20972.0 21210.0 23872.0 21956.0 26591.0 [2,] 33710.0 29725.5 32395.5 32591.5 34512.0 35029.0 36718.5 35670.0 35585.5 [3,] 44003.5 38150.5 38944.5 39298.5 39389.5 44154.5 46914.0 46110.0 39197.5 [4,] 47035.5 52780.0 43900.0 48782.0 49074.5 53262.5 49864.0 56832.5 47090.5 [5,] 58608.0 56421.0 50556.0 61465.0 52518.0 65540.0 59723.0 62300.0 50736.0 [,10] [,11] [,12] [,13] [1,] 29450.0 35331 22012.0 NA [2,] 38775.0 41256 35006.5 NA [3,] 45855.5 48964 41670.5 NA [4,] 52085.5 53776 46722.5 NA [5,] 64830.0 64172 60487.0 NA $n [1] 12 12 12 12 12 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 37925.65 27635.19 33697.22 31913.9 32747.45 35838.08 40918.25 36457.64 [2,] 50081.35 48665.81 44191.78 46683.1 46031.55 52470.92 52909.75 55762.36 [,9] [,10] [,11] [,12] [,13] [1,] 33949.99 39784.49 43253.54 36326.75 NA [2,] 44445.01 51926.51 54674.46 47014.25 NA $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" NA Warning message: In bxp(list(stats = c(21538, 33710, 44003.5, 47035.5, 58608, 18387, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7i7xo1381945996.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,] 25546.08 22942.00 23971.00 [2,] 35077.71 35241.50 34982.94 [3,] 43235.88 43402.25 42961.88 [4,] 50308.46 49360.75 50291.25 [5,] 57551.17 58690.00 57187.38 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 36289.03 36962.37 35979.65 [2,] 50182.72 49842.13 49944.10 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(25546.0833333333, 35077.7083333333, 43235.875, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1vaez1381945996.ps tmp/1vaez1381945996.png",intern=TRUE)) character(0) > try(system("convert tmp/2qaqx1381945996.ps tmp/2qaqx1381945996.png",intern=TRUE)) character(0) > try(system("convert tmp/373ca1381945996.ps tmp/373ca1381945996.png",intern=TRUE)) character(0) > try(system("convert tmp/4l49t1381945996.ps tmp/4l49t1381945996.png",intern=TRUE)) character(0) > try(system("convert tmp/5izf11381945996.ps tmp/5izf11381945996.png",intern=TRUE)) character(0) > try(system("convert tmp/647lo1381945996.ps tmp/647lo1381945996.png",intern=TRUE)) character(0) > try(system("convert tmp/7i7xo1381945996.ps tmp/7i7xo1381945996.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.495 0.756 4.235