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(24514,24442,24364,24222,25689,25618,24514,23780,23851,23851,23922,24072,24514,24735,25105,25397,26722,26573,25468,23851,24143,24442,24364,24735,24442,24955,25176,25247,26872,26573,25468,23851,24143,23922,24293,25105,25027,24884,25247,25468,26722,26793,25468,23559,23409,23851,23481,24663,24663,24222,24806,25176,26430,26793,25247,23409,23409,22818,22376,23338,22968,22084,22676,23189,24735,25326,23702,22526,22526,22084,21792,22376,21643,21493,21864,22376,23922,24222,22305,20909,20246,19584,19213,19947,19506,19584,19947,20246,21714,21935,19584,18480,17375,16635,16122,16855,16492,17076,17297,17518,18480,19064,16122,15388,13543,12367,11997,13030,12439,13179,13179,13251,14134,14725,11854,10821,9126,8022,7437,8905) > 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,] 24514 24514 24442 25027 24663 22968 21643 19506 16492 12439 NA [2,] 24442 24735 24955 24884 24222 22084 21493 19584 17076 13179 NA [3,] 24364 25105 25176 25247 24806 22676 21864 19947 17297 13179 NA [4,] 24222 25397 25247 25468 25176 23189 22376 20246 17518 13251 NA [5,] 25689 26722 26872 26722 26430 24735 23922 21714 18480 14134 NA [6,] 25618 26573 26573 26793 26793 25326 24222 21935 19064 14725 NA [7,] 24514 25468 25468 25468 25247 23702 22305 19584 16122 11854 NA [8,] 23780 23851 23851 23559 23409 22526 20909 18480 15388 10821 NA [9,] 23851 24143 24143 23409 23409 22526 20246 17375 13543 9126 NA [10,] 23851 24442 23922 23851 22818 22084 19584 16635 12367 8022 NA [11,] 23922 24364 24293 23481 22376 21792 19213 16122 11997 7437 NA [12,] 24072 24735 25105 24663 23338 22376 19947 16855 13030 8905 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] -72 221 513 -143 -441 -884 -150 78 584 740 NA [2,] -78 370 221 363 584 592 371 363 221 0 NA [3,] -142 292 71 221 370 513 512 299 221 72 NA [4,] 1467 1325 1625 1254 1254 1546 1546 1468 962 883 NA [5,] -71 -149 -299 71 363 591 300 221 584 591 NA [6,] -1104 -1105 -1105 -1325 -1546 -1624 -1917 -2351 -2942 -2871 NA [7,] -734 -1617 -1617 -1909 -1838 -1176 -1396 -1104 -734 -1033 NA [8,] 71 292 292 -150 0 0 -663 -1105 -1845 -1695 NA [9,] 0 299 -221 442 -591 -442 -662 -740 -1176 -1104 NA [10,] 71 -78 371 -370 -442 -292 -371 -513 -370 -585 NA [11,] 150 371 812 1182 962 584 734 733 1033 1468 NA [12,] 442 -293 -78 0 -370 -733 -441 -363 -591 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/1f3h71408293892.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/2ejqy1408293892.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/383ns1408293892.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/4c96x1408293892.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,] 12439 13179 13179 13251.0 18480 19064 11854 10821.0 9126.0 8022 7437 [2,] 19506 19584 19947 20246.0 21714 21935 19584 18480.0 17375.0 16635 16122 [3,] 23705 23153 23520 23705.5 25212 25472 24108 22967.5 22967.5 22451 22084 [4,] 24514 24735 25105 25247.0 26722 26573 25468 23780.0 23851.0 23851 23922 [5,] 25027 24955 25247 25468.0 26872 26793 25468 23851.0 24143.0 24442 24364 [,12] [1,] 8905 [2,] 16855 [3,] 22857 [4,] 24663 [5,] 25105 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 21202.8 20579.36 20942.86 21206.8 22709.8 23154.67 21168.12 20319.41 [2,] 26207.2 25726.64 26097.14 26204.2 27714.2 27789.33 27047.88 25615.59 [,9] [,10] [,11] [,12] [1,] 19731.83 18845.6 18186.81 18955.81 [2,] 26203.17 26056.4 25981.19 26758.19 $out [1] 14134 14725 $group [1] 5 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(12439, 19506, 23705, 24514, 25027, 13179, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5gei31408293892.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,] -884 0 -142.0 883 -299.0 -2942 -1909 -1845 -1176.0 -585 150 -733 [2,] -150 221 72.0 1254 -71.0 -2351 -1617 -1105 -740.0 -442 584 -441 [3,] 3 363 256.5 1396 260.5 -1585 -1286 -75 -516.5 -370 773 -363 [4,] 513 371 370.0 1546 584.0 -1105 -1033 71 0.0 -78 1033 -78 [5,] 740 592 513.0 1625 591.0 -1104 -734 292 442.0 371 1468 442 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -328.2612 288.054 107.6073 1250.105 -66.76412 -2207.5513 -1577.7897 [2,] 334.2612 437.946 405.3927 1541.895 587.76412 -962.4487 -994.2103 [,8] [,9] [,10] [,11] [,12] [1,] -662.5765 -886.2335 -551.8689 548.6617 -554.18 [2,] 512.5765 -146.7665 -188.1311 997.3383 -171.82 $out [1] -78 $group [1] 2 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-884, -150, 3, 513, 740, 0, 221, 363, 371, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/64ccb1408293892.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,] 23780.0 23851.0 23851.0 23409.0 22376.0 21792.0 19213.0 16122.0 11997.0 [2,] 23886.5 24403.0 24218.0 23705.0 23373.5 22230.0 20096.5 17115.0 13286.5 [3,] 24293.0 24735.0 25030.0 24955.5 24442.5 22601.0 21568.0 19545.0 16307.0 [4,] 24514.0 25432.5 25357.5 25468.0 25211.5 23445.5 22340.5 20096.5 17407.5 [5,] 24514.0 26722.0 26872.0 26793.0 26793.0 24735.0 24222.0 21935.0 19064.0 [,10] [,11] [1,] 7437.0 NA [2,] 9015.5 NA [3,] 12146.5 NA [4,] 13215.0 NA [5,] 14725.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,] 24006.79 24265.44 24510.27 24151.38 23604.18 22046.6 20544.5 18185.12 [2,] 24579.21 25204.56 25549.73 25759.62 25280.82 23155.4 22591.5 20904.88 [,9] [,10] [,11] [1,] 14427.38 10231.08 NA [2,] 18186.62 14061.92 NA $out [1] 25689 25618 25326 $group [1] 1 1 6 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(23780, 23886.5, 24293, 24514, 24514, 23851, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7q0we1408293892.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,] 19499.70 22084.00 20353.25 [2,] 20239.85 22912.25 20994.12 [3,] 21643.10 23336.50 22319.31 [4,] 22091.10 23906.75 22921.19 [5,] 23762.20 25212.00 24539.88 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 20798.73 22882.9 21440.37 [2,] 22487.47 23790.1 23198.26 $out [1] 25472 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(19499.7, 20239.85, 21643.1, 22091.1, 23762.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1f3h71408293892.ps tmp/1f3h71408293892.png",intern=TRUE)) character(0) > try(system("convert tmp/2ejqy1408293892.ps tmp/2ejqy1408293892.png",intern=TRUE)) character(0) > try(system("convert tmp/383ns1408293892.ps tmp/383ns1408293892.png",intern=TRUE)) character(0) > try(system("convert tmp/4c96x1408293892.ps tmp/4c96x1408293892.png",intern=TRUE)) character(0) > try(system("convert tmp/5gei31408293892.ps tmp/5gei31408293892.png",intern=TRUE)) character(0) > try(system("convert tmp/64ccb1408293892.ps tmp/64ccb1408293892.png",intern=TRUE)) character(0) > try(system("convert tmp/7q0we1408293892.ps tmp/7q0we1408293892.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.489 0.306 2.831