R version 3.0.1 (2013-05-16) -- "Good Sport" 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(42364,42206,42046,41715,44991,44818,42364,40733,40891,40891,41067,41382,41873,41873,41558,40733,44991,45640,44660,42364,43346,41873,42538,42855,43186,42364,42538,41382,44991,46131,45151,43346,45309,43186,45151,44991,45482,43678,45640,45482,48426,47762,45151,43835,45640,43186,44991,45309,45973,44502,45309,45800,47604,46131,44169,42046,44011,38611,41224,42695,44169,42046,42046,42046,43186,41558,39420,37631,38929,33862,36967,38771,39102,37298,37455,36967,38611,37455,35178,33531,36315,30269,34195,35984,35984,33862,31900,31742,33531,31900,28798,26660,28956,23558,28464,31075,31900,30096,27816,29447,30096,29604,24696,22418,24047,19140,24207,26011,27482,25029,22733,24047,24696,23398,18491,16353,18316,12918,18807,22418) > 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,] 42364 41873 43186 45482 45973 44169 39102 35984 31900 27482 NA [2,] 42206 41873 42364 43678 44502 42046 37298 33862 30096 25029 NA [3,] 42046 41558 42538 45640 45309 42046 37455 31900 27816 22733 NA [4,] 41715 40733 41382 45482 45800 42046 36967 31742 29447 24047 NA [5,] 44991 44991 44991 48426 47604 43186 38611 33531 30096 24696 NA [6,] 44818 45640 46131 47762 46131 41558 37455 31900 29604 23398 NA [7,] 42364 44660 45151 45151 44169 39420 35178 28798 24696 18491 NA [8,] 40733 42364 43346 43835 42046 37631 33531 26660 22418 16353 NA [9,] 40891 43346 45309 45640 44011 38929 36315 28956 24047 18316 NA [10,] 40891 41873 43186 43186 38611 33862 30269 23558 19140 12918 NA [11,] 41067 42538 45151 44991 41224 36967 34195 28464 24207 18807 NA [12,] 41382 42855 44991 45309 42695 38771 35984 31075 26011 22418 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [1,] -158 0 -822 -1804 -1471 -2123 -1804 -2122 -1804 -2453 NA [2,] -160 -315 174 1962 807 0 157 -1962 -2280 -2296 NA [3,] -331 -825 -1156 -158 491 0 -488 -158 1631 1314 NA [4,] 3276 4258 3609 2944 1804 1140 1644 1789 649 649 NA [5,] -173 649 1140 -664 -1473 -1628 -1156 -1631 -492 -1298 NA [6,] -2454 -980 -980 -2611 -1962 -2138 -2277 -3102 -4908 -4907 NA [7,] -1631 -2296 -1805 -1316 -2123 -1789 -1647 -2138 -2278 -2138 NA [8,] 158 982 1963 1805 1965 1298 2784 2296 1629 1963 NA [9,] 0 -1473 -2123 -2454 -5400 -5067 -6046 -5398 -4907 -5398 NA [10,] 176 665 1965 1805 2613 3105 3926 4906 5067 5889 NA [11,] 315 317 -160 318 1471 1804 1789 2611 1804 3611 NA [12,] 491 331 491 664 1474 331 0 825 1471 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/fisher/rcomp/tmp/1tnmg1376736796.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/fisher/rcomp/tmp/2suo61376736796.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/fisher/rcomp/tmp/38b271376736796.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/fisher/rcomp/tmp/4s7eo1376736796.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,] 27482.0 25029.0 22733 24047.0 24696.0 23398 18491 16353 18316 12918.0 [2,] 35984.0 33862.0 31900 31742.0 33531.0 31900 28798 26660 28956 23558.0 [3,] 42118.5 41959.5 41802 41057.5 44088.5 43188 40892 39182 39910 36236.5 [4,] 44169.0 42364.0 42538 42046.0 44991.0 46131 44660 42364 44011 41873.0 [5,] 45973.0 44502.0 45640 45800.0 48426.0 47762 45151 43835 45640 43186.0 [,11] [,12] [1,] 18807 22418.0 [2,] 28464 31075.0 [3,] 39017 40076.5 [4,] 42538 42855.0 [5,] 45151 45309.0 $n [1] 10 10 10 10 10 10 10 10 10 10 10 10 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 38028.95 37711.56 36486.83 35909.21 38362.63 36077.63 32966.71 31335.66 [2,] 46208.05 46207.44 47117.17 46205.79 49814.37 50298.37 48817.29 47028.34 [,9] [,10] [,11] [,12] [1,] 32387.92 27085.6 31985.07 34190.74 [2,] 47432.08 45387.4 46048.93 45962.26 $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(27482, 35984, 42118.5, 44169, 45973, 25029, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/5sw411376736796.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,] -2453 -2296 -1156 649.0 -1631 -3102.0 -2296 982 -6046 176 -160 0 [2,] -2122 -1962 -488 1140.0 -1473 -3102.0 -2138 1298 -5398 1805 317 331 [3,] -1804 -80 -158 1796.5 -910 -2365.5 -1964 1884 -4987 2859 1630 491 [4,] -822 174 491 3276.0 -173 -1962.0 -1647 1965 -2123 4906 1804 825 [5,] 0 1962 1631 4258.0 1140 -980.0 -1316 2784 0 5889 3611 1474 $n [1] 10 10 10 10 10 10 10 10 10 10 10 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -2453.532 -1147.2308 -647.1474 729.2692 -1559.5318 -2935.089 -2209.323 [2,] -1154.468 987.2308 331.1474 2863.7308 -260.4682 -1795.911 -1718.677 [,8] [,9] [,10] [,11] [,12] [1,] 1550.74 -6623.321 1309.617 887.0355 230.8267 [2,] 2217.26 -3350.679 4408.383 2372.9645 751.1733 $out [1] -4908 -4907 158 $group [1] 6 6 8 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2453, -2122, -1804, -822, 0, -2296, -1962, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/6ghek1376736796.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,] 40733.0 40733 41382.0 43186.0 38611.0 33862 33531.0 23558.0 19140.0 [2,] 40979.0 41873 42862.0 44413.0 42370.5 38201 34686.5 28631.0 24127.0 [3,] 41880.5 42451 44168.5 45395.5 44335.5 40489 36641.0 31408.5 26913.5 [4,] 42364.0 44003 45151.0 45640.0 45886.5 42046 37455.0 32715.5 29850.0 [5,] 42364.0 45640 46131.0 45640.0 47604.0 44169 39102.0 35984.0 31900.0 [,10] [,11] [1,] 12918.0 NA [2,] 18403.5 NA [3,] 22575.5 NA [4,] 24371.5 NA [5,] 27482.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,] 41248.79 41479.49 43124.47 44835.86 42731.83 38735.27 35378.27 29545.53 [2,] 42512.21 43422.51 45212.53 45955.14 45939.17 42242.73 37903.73 33271.47 [,9] [,10] [,11] [1,] 24303.2 19853.46 NA [2,] 29523.8 25297.54 NA $out [1] 44991 44818 48426 47762 30269 $group [1] 1 1 4 4 7 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" NA Warning message: In bxp(list(stats = c(40733, 40979, 41880.5, 42364, 42364, 40733, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/75r8x1376736796.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,] 32749.40 36236.50 33431.62 [2,] 36168.55 39546.00 36686.69 [3,] 37526.60 40974.75 37532.19 [4,] 38867.55 42039.00 39085.62 [5,] 40112.30 44088.50 40343.38 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 36295.57 39837.68 36438.02 [2,] 38757.63 42111.82 38626.36 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(32749.4, 36168.55, 37526.6, 38867.55, 40112.3, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/1tnmg1376736796.ps tmp/1tnmg1376736796.png",intern=TRUE)) character(0) > try(system("convert tmp/2suo61376736796.ps tmp/2suo61376736796.png",intern=TRUE)) character(0) > try(system("convert tmp/38b271376736796.ps tmp/38b271376736796.png",intern=TRUE)) character(0) > try(system("convert tmp/4s7eo1376736796.ps tmp/4s7eo1376736796.png",intern=TRUE)) character(0) > try(system("convert tmp/5sw411376736796.ps tmp/5sw411376736796.png",intern=TRUE)) character(0) > try(system("convert tmp/6ghek1376736796.ps tmp/6ghek1376736796.png",intern=TRUE)) character(0) > try(system("convert tmp/75r8x1376736796.ps tmp/75r8x1376736796.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.335 0.815 4.136