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(66329,50326,47182,42247,45796,48233,40079,39596,41275,41875,29784,7199,56166,33936,34532,30261,30857,35461,33525,27825,33624,35618,27329,8081,62751,37565,44749,37537,36825,50679,38488,36522,45545,43571,37343,11593,74784,49019,56601,47634,49807,50499,42092,39064,44376,43616,41059,17226,70170,43949,52333,41034,47760,76115,30918,32994,31947,26763,30251,18211,47957,31901,35560,30408,30083,35044,30475,28308,31395,36311,40426,38948) > 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,] 66329 56166 62751 74784 70170 47957 NA [2,] 50326 33936 37565 49019 43949 31901 NA [3,] 47182 34532 44749 56601 52333 35560 NA [4,] 42247 30261 37537 47634 41034 30408 NA [5,] 45796 30857 36825 49807 47760 30083 NA [6,] 48233 35461 50679 50499 76115 35044 NA [7,] 40079 33525 38488 42092 30918 30475 NA [8,] 39596 27825 36522 39064 32994 28308 NA [9,] 41275 33624 45545 44376 31947 31395 NA [10,] 41875 35618 43571 43616 26763 36311 NA [11,] 29784 27329 37343 41059 30251 40426 NA [12,] 7199 8081 11593 17226 18211 38948 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -16003 -22230 -25186 -25765 -26221 -16056 NA [2,] -3144 596 7184 7582 8384 3659 NA [3,] -4935 -4271 -7212 -8967 -11299 -5152 NA [4,] 3549 596 -712 2173 6726 -325 NA [5,] 2437 4604 13854 692 28355 4961 NA [6,] -8154 -1936 -12191 -8407 -45197 -4569 NA [7,] -483 -5700 -1966 -3028 2076 -2167 NA [8,] 1679 5799 9023 5312 -1047 3087 NA [9,] 600 1994 -1974 -760 -5184 4916 NA [10,] -12091 -8289 -6228 -2557 3488 4115 NA [11,] -22585 -19248 -25750 -23833 -12040 -1478 NA [12,] 48967 54670 63191 52944 29746 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/1m3h51419938124.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/245tv1419938124.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/3za4w1419938124.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/49x2o1419938124.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,] 47957 31901 34532.0 30261.0 30083.0 35044 30475.0 27825 31395.0 26763 [2,] 56166 33936 35560.0 30408.0 30857.0 35461 30918.0 28308 31947.0 35618 [3,] 64540 40757 45965.5 39285.5 41310.5 49366 36006.5 34758 37449.5 39093 [4,] 70170 49019 52333.0 42247.0 47760.0 50679 40079.0 39064 44376.0 43571 [5,] 74784 50326 56601.0 47634.0 49807.0 50679 42092.0 39596 45545.0 43616 [,11] [,12] [1,] 27329 7199.0 [2,] 29784 8081.0 [3,] 33797 14409.5 [4,] 40426 18211.0 [5,] 41059 18211.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,] 55506.97 31027.98 35146.37 31648.96 30407.52 39549.9 30097.36 27820.03 [2,] 73573.03 50486.02 56784.63 46922.04 52213.48 59182.1 41915.64 41695.97 [,9] [,10] [,11] [,12] [1,] 29432.39 33963.06 26932.57 7875.323 [2,] 45466.61 44222.94 40661.43 20943.677 $out [1] 76115 38948 $group [1] 6 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(47957, 56166, 64540, 70170, 74784, 31901, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5kp5r1419938124.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,] -26221 -3144.0 -11299 -712.0 692.0 -12191.0 -5700.0 -1047.0 -5184 [2,] -25765 596.0 -8967 -325.0 2437.0 -12191.0 -3028.0 1679.0 -1974 [3,] -23708 5421.5 -6182 1384.5 4782.5 -8280.5 -2066.5 4199.5 -80 [4,] -16056 7582.0 -4935 3549.0 13854.0 -4569.0 -483.0 5799.0 1994 [5,] -16003 8384.0 -4271 6726.0 28355.0 -1936.0 2076.0 9023.0 4916 [,10] [,11] [,12] [1,] -12091.0 -25750.0 48967 [2,] -8289.0 -23833.0 48967 [3,] -4392.5 -20916.5 52944 [4,] 3488.0 -12040.0 54670 [5,] 4115.0 -1478.0 63191 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -29970.62 915.3044 -8782.77 -1114.355 -2581.834 -13196.936 -3708.1072 [2,] -17445.38 9927.6956 -3581.23 3883.355 12146.834 -3364.064 -424.8928 [,8] [,9] [,10] [,11] [,12] [1,] 1541.967 -2639.488 -11989.045 -28523.37 48914.27 [2,] 6857.033 2479.488 3204.045 -13309.63 56973.73 $out [1] -45197 29746 $group [1] 6 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-26221, -25765, -23708, -16056, -16003, -3144, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/6li1n1419938124.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,] 29784.0 27329.0 36522.0 39064.0 18211.0 28308.0 NA [2,] 39837.5 29043.0 37084.0 41575.5 30584.5 30441.5 NA [3,] 42061.0 33574.5 38026.5 46005.0 37014.0 33472.5 NA [4,] 47707.5 34996.5 45147.0 50153.0 50046.5 37629.5 NA [5,] 50326.0 35618.0 50679.0 56601.0 76115.0 47957.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 38471.44 30859.07 34348.91 42092.74 28137.25 30194 NA [2,] 45650.56 36289.93 41704.09 49917.26 45890.75 36751 NA $out [1] 66329 7199 56166 8081 62751 11593 74784 17226 $group [1] 1 1 2 2 3 3 4 4 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(29784, 39837.5, 42061, 47707.5, 50326, 27329, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ee6k1419938124.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,] 34051.50 33797.00 33954.00 [2,] 35147.42 35382.25 35201.75 [3,] 38106.92 39189.25 38726.31 [4,] 43137.75 43638.00 42874.31 [5,] 49338.50 49366.00 44644.00 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 34462.47 35423.75 35226.81 [2,] 41751.36 42954.75 42225.82 $out [1] 63026.17 16876.33 64540.00 14409.50 63511.00 13461.88 $group [1] 1 1 2 2 3 3 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(34051.5, 35147.4166666667, 38106.9166666667, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1m3h51419938124.ps tmp/1m3h51419938124.png",intern=TRUE)) character(0) > try(system("convert tmp/245tv1419938124.ps tmp/245tv1419938124.png",intern=TRUE)) character(0) > try(system("convert tmp/3za4w1419938124.ps tmp/3za4w1419938124.png",intern=TRUE)) character(0) > try(system("convert tmp/49x2o1419938124.ps tmp/49x2o1419938124.png",intern=TRUE)) character(0) > try(system("convert tmp/5kp5r1419938124.ps tmp/5kp5r1419938124.png",intern=TRUE)) character(0) > try(system("convert tmp/6li1n1419938124.ps tmp/6li1n1419938124.png",intern=TRUE)) character(0) > try(system("convert tmp/7ee6k1419938124.ps tmp/7ee6k1419938124.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.809 0.499 3.336