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(24175,23658,26727,24397,25829,25503,24914,24875,25461,27647,28382,25259,28100,27900,28078,28479,28156,29219,28782,27078,30031,29579,26532,23995,22067,21818,23787,21551,21309,22395,22906,21430,23492,24144,24438,24689,24569,23754,28473,27051,27081,29635,27715,26373,28009,29472,30005,29777,28886,28549,33348,29017,30924,30435,29431,30290,31286,30622,31742,30391,30740,32086,33947,31312,33239,32362,32170,32665,31412,34891,33919,30706,32846,31368,33130,31665,33139,32201,32230,30287,31918,33853,32232,31484) > 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] 84 > (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] 7 7 7 7 7 7 7 7 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 24175 28100 22067 24569 28886 30740 32846 NA [2,] 23658 27900 21818 23754 28549 32086 31368 NA [3,] 26727 28078 23787 28473 33348 33947 33130 NA [4,] 24397 28479 21551 27051 29017 31312 31665 NA [5,] 25829 28156 21309 27081 30924 33239 33139 NA [6,] 25503 29219 22395 29635 30435 32362 32201 NA [7,] 24914 28782 22906 27715 29431 32170 32230 NA [8,] 24875 27078 21430 26373 30290 32665 30287 NA [9,] 25461 30031 23492 28009 31286 31412 31918 NA [10,] 27647 29579 24144 29472 30622 34891 33853 NA [11,] 28382 26532 24438 30005 31742 33919 32232 NA [12,] 25259 23995 24689 29777 30391 30706 31484 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] -517 -200 -249 -815 -337 1346 -1478 NA [2,] 3069 178 1969 4719 4799 1861 1762 NA [3,] -2330 401 -2236 -1422 -4331 -2635 -1465 NA [4,] 1432 -323 -242 30 1907 1927 1474 NA [5,] -326 1063 1086 2554 -489 -877 -938 NA [6,] -589 -437 511 -1920 -1004 -192 29 NA [7,] -39 -1704 -1476 -1342 859 495 -1943 NA [8,] 586 2953 2062 1636 996 -1253 1631 NA [9,] 2186 -452 652 1463 -664 3479 1935 NA [10,] 735 -3047 294 533 1120 -972 -1621 NA [11,] -3123 -2537 251 -228 -1351 -3213 -748 NA [12,] 2841 -1928 -120 -891 349 2140 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/1jtw01413464804.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/2djhs1413464804.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/3kvme1413464804.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/44mn41413464804.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] [1,] 22067 21818.0 23787.0 21551.0 21309.0 22395 22906.0 21430.0 23492 24144.0 [2,] 24372 23706.0 27402.5 25724.0 26455.0 27361 26314.5 25624.0 26735 28559.5 [3,] 28100 27900.0 28473.0 28479.0 28156.0 29635 28782.0 27078.0 30031 29579.0 [4,] 29813 29958.5 33239.0 30164.5 32031.5 31318 30800.5 30288.5 31349 32237.5 [5,] 32846 32086.0 33947.0 31665.0 33239.0 32362 32230.0 32665.0 31918 34891.0 [,11] [,12] [1,] 24438 23995.0 [2,] 27457 24974.0 [3,] 30005 29777.0 [4,] 31987 30548.5 [5,] 33919 31484.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 24850.72 24166.11 24987.54 25827.21 24825.8 27271.94 26103.03 24292.44 [2,] 31349.28 31633.89 31958.46 31130.79 31486.2 31998.06 31460.97 29863.56 [,9] [,10] [,11] [,12] [1,] 27275.59 27382.56 27299.76 26448 [2,] 32786.41 31775.44 32710.24 33106 $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(22067, 24372, 28100, 29813, 32846, 21818, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5xhgo1413464804.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,] -815.0 178.0 -2635.0 -323.0 -938.0 -1004.0 -1943 586 -664.0 -3047.0 [2,] -666.0 1811.5 -2482.5 -106.0 -683.0 -796.5 -1590 791 100.0 -1296.5 [3,] -337.0 1969.0 -2236.0 1432.0 -326.0 -437.0 -1342 1631 1463.0 294.0 [4,] -224.5 3894.0 -1443.5 1690.5 1074.5 -81.5 228 1849 2060.5 634.0 [5,] -200.0 4799.0 -1422.0 1927.0 2554.0 511.0 859 2953 3479.0 1120.0 [,11] [,12] [1,] -3213 -1928.0 [2,] -2830 -891.0 [3,] -1351 114.5 [4,] -488 2140.0 [5,] 251 2841.0 $n [1] 7 7 7 7 7 7 7 7 7 7 7 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -600.65668 725.3646 -2856.474 359.1592 -1375.5506 -863.98647 -2427.6803 [2,] -73.34332 3212.6354 -1615.526 2504.8408 723.5506 -10.01353 -256.3197 [,8] [,9] [,10] [,11] [,12] [1,] 999.1795 292.221 -858.8635 -2749.60462 -1840.593 [2,] 2262.8205 2633.779 1446.8635 47.60462 2069.593 $out [1] 1346 -1478 401 -4331 -1920 -1253 $group [1] 1 1 3 3 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-815, -666, -337, -224.5, -200, 178, 1811.5, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/66yjp1413464804.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,] 23658 26532.0 21309.0 23754.0 28549 30706 30287.0 NA [2,] 24636 27489.0 21684.5 26712.0 29224 31362 31574.5 NA [3,] 25360 28128.0 22650.5 27862.0 30413 32266 32215.5 NA [4,] 26278 29000.5 23965.5 29553.5 31105 33579 32988.0 NA [5,] 28382 30031.0 24689.0 30005.0 33348 34891 33853.0 NA $n [1] 12 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 24611.07 27438.59 21610.12 26565.97 29555.06 31254.81 31570.79 NA [2,] 26108.93 28817.41 23690.88 29158.03 31270.94 33277.19 32860.21 NA $out [1] 23995 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(23658, 24636, 25360, 26278, 28382, 26532, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7x0ww1413464804.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,] 27019.00 27078.0 26832.25 [2,] 27605.00 28128.0 27852.75 [3,] 28416.07 28630.5 28799.75 [4,] 29214.29 29706.0 29530.75 [5,] 30029.71 30031.0 30398.50 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 27682.07 27910.76 28034.4 [2,] 29150.08 29350.24 29565.1 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(27019, 27605, 28416.0714285714, 29214.2857142857, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1jtw01413464804.ps tmp/1jtw01413464804.png",intern=TRUE)) character(0) > try(system("convert tmp/2djhs1413464804.ps tmp/2djhs1413464804.png",intern=TRUE)) character(0) > try(system("convert tmp/3kvme1413464804.ps tmp/3kvme1413464804.png",intern=TRUE)) character(0) > try(system("convert tmp/44mn41413464804.ps tmp/44mn41413464804.png",intern=TRUE)) character(0) > try(system("convert tmp/5xhgo1413464804.ps tmp/5xhgo1413464804.png",intern=TRUE)) character(0) > try(system("convert tmp/66yjp1413464804.ps tmp/66yjp1413464804.png",intern=TRUE)) character(0) > try(system("convert tmp/7x0ww1413464804.ps tmp/7x0ww1413464804.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.482 0.385 2.902