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(31566,30111,30019,31934,25826,26835,20205,17789,20520,22518,15572,11509,25447,24090,27786,26195,20516,22759,19028,16971,20036,22485,18730,14538,27561,25985,34670,32066,27186,29586,21359,21553,19573,24256,22380,16167,27297,28287,33474,28229,28785,25597,18130,20198,22849,23118,21925,20801,18785,20659,29367,23992,20645,22356,17902,15879,16963,21035,17988,10437,24470,22237,27053,26419,22311,20624,17336,15586,17733,19231,16102,11770) > 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,] 31566 25447 27561 27297 18785 24470 NA [2,] 30111 24090 25985 28287 20659 22237 NA [3,] 30019 27786 34670 33474 29367 27053 NA [4,] 31934 26195 32066 28229 23992 26419 NA [5,] 25826 20516 27186 28785 20645 22311 NA [6,] 26835 22759 29586 25597 22356 20624 NA [7,] 20205 19028 21359 18130 17902 17336 NA [8,] 17789 16971 21553 20198 15879 15586 NA [9,] 20520 20036 19573 22849 16963 17733 NA [10,] 22518 22485 24256 23118 21035 19231 NA [11,] 15572 18730 22380 21925 17988 16102 NA [12,] 11509 14538 16167 20801 10437 11770 NA > darr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -1455 -1357 -1576 990 1874 -2233 NA [2,] -92 3696 8685 5187 8708 4816 NA [3,] 1915 -1591 -2604 -5245 -5375 -634 NA [4,] -6108 -5679 -4880 556 -3347 -4108 NA [5,] 1009 2243 2400 -3188 1711 -1687 NA [6,] -6630 -3731 -8227 -7467 -4454 -3288 NA [7,] -2416 -2057 194 2068 -2023 -1750 NA [8,] 2731 3065 -1980 2651 1084 2147 NA [9,] 1998 2449 4683 269 4072 1498 NA [10,] -6946 -3755 -1876 -1193 -3047 -3129 NA [11,] -4063 -4192 -6213 -1124 -7551 -4332 NA [12,] 13938 13023 11130 -2016 14033 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/15jhu1413040630.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/28x5d1413040630.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/346k01413040630.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/425wl1413040630.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,] 24470 20659.0 27053 23992 20516.0 20624 17336 15586 16963.0 19231.0 15572 [2,] 24470 22237.0 27786 26195 20645.0 22356 17902 15879 17733.0 21035.0 16102 [3,] 26372 25037.5 29693 27324 24068.5 24178 18579 17380 19804.5 22501.5 18359 [4,] 27561 28287.0 33474 31934 27186.0 26835 20205 20198 20520.0 23118.0 21925 [5,] 31566 30111.0 34670 32066 28785.0 29586 21359 21553 22849.0 24256.0 22380 [,12] [1,] 10437 [2,] 11509 [3,] 13154 [4,] 16167 [5,] 20801 $n [1] 6 6 6 6 6 6 6 6 6 6 6 6 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 24378.21 21135.05 26024.06 23622.16 19849.34 21288.9 17093.49 14594.11 [2,] 28365.79 28939.95 33361.94 31025.84 28287.66 27067.1 20064.51 20165.89 [,9] [,10] [,11] [,12] [1,] 18006.79 21157.9 14602.98 10149.44 [2,] 21602.21 23845.1 22115.02 16158.56 $out [1] 18785 $group [1] 1 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(24470, 24470, 26372, 27561, 31566, 20659, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5f4iy1413040630.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] [1,] -2233 -92.0 -5375.0 -6108 -3188 -8227 -2416.0 1084 269.0 -3755 -7551 [2,] -1576 3696.0 -5245.0 -5679 -1687 -7467 -2057.0 1084 1498.0 -3755 -6213 [3,] -1406 5001.5 -2097.5 -4494 1360 -5542 -1886.5 2399 2223.5 -3088 -4262 [4,] 990 8685.0 -634.0 -3347 2243 -3731 194.0 2731 4072.0 -1876 -4063 [5,] 1874 8708.0 1915.0 -3347 2400 -3288 2068.0 3065 4683.0 -1193 -1124 [,12] [1,] 11130 [2,] 11130 [3,] 13023 [4,] 13938 [5,] 14033 $n [1] 6 6 6 6 6 6 6 6 6 6 6 5 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -3061.1529 1783.434 -5071.7439 -5998.215 -1174.977 -7951.841 -3338.4677 [2,] 249.1529 8219.566 876.7439 -2989.785 3894.977 -3132.159 -434.5323 [,8] [,9] [,10] [,11] [,12] [1,] 1336.632 563.1869 -4300.016 -5648.819 11038.87 [2,] 3461.368 3883.8131 -1875.984 -2875.181 15007.13 $out [1] 556 -1980 -6946 -2016 $group [1] 4 8 10 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(-2233, -1576, -1406, 990, 1874, -92, 3696, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/67x241413040630.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,] 11509 14538.0 16167.0 18130.0 15879.0 11770.0 NA [2,] 18997 18879.0 21456.0 21363.0 17432.5 16719.0 NA [3,] 24172 21500.5 25120.5 24357.5 19715.0 19927.5 NA [4,] 30065 24768.5 28573.5 28258.0 21695.5 23390.5 NA [5,] 31934 27786.0 34670.0 33474.0 23992.0 27053.0 NA $n [1] 12 12 12 12 12 12 0 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 19123.81 18814.26 21874.16 21212.64 17770.62 16884.58 NA [2,] 29220.19 24186.74 28366.84 27502.36 21659.38 22970.42 NA $out [1] 29367 10437 $group [1] 5 5 $names [1] "1" "2" "3" "4" "5" "6" NA Warning message: In bxp(list(stats = c(11509, 18997, 24172, 30065, 31934, 14538, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7plbo1413040630.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,] 14203.67 13154.00 13667.00 [2,] 18888.08 18469.00 18892.38 [3,] 23159.33 23285.00 23068.25 [4,] 25541.25 25704.75 25655.25 [5,] 30394.83 29693.00 30395.75 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 20124.78 19984.73 19983.66 [2,] 26193.89 26585.27 26152.84 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(14203.6666666667, 18888.0833333333, 23159.3333333333, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > try(system("convert tmp/15jhu1413040630.ps tmp/15jhu1413040630.png",intern=TRUE)) character(0) > try(system("convert tmp/28x5d1413040630.ps tmp/28x5d1413040630.png",intern=TRUE)) character(0) > try(system("convert tmp/346k01413040630.ps tmp/346k01413040630.png",intern=TRUE)) character(0) > try(system("convert tmp/425wl1413040630.ps tmp/425wl1413040630.png",intern=TRUE)) character(0) > try(system("convert tmp/5f4iy1413040630.ps tmp/5f4iy1413040630.png",intern=TRUE)) character(0) > try(system("convert tmp/67x241413040630.ps tmp/67x241413040630.png",intern=TRUE)) character(0) > try(system("convert tmp/7plbo1413040630.ps tmp/7plbo1413040630.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.382 0.422 2.838