R version 2.8.0 (2008-10-20) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(15044.5,14944.2,16754.8,14254,15454.9,15644.8,14568.3,12520.2,14803,15873.2,14755.3,12875.1,14291.1,14205.3,15859.4,15258.9,15498.6,15106.5,15023.6,12083,15761.3,16943,15070.3,13659.6,14768.9,14725.1,15998.1,15370.6,14956.9,15469.7,15101.8,11703.7,16283.6,16726.5,14968.9,14861,14583.3,15305.8,17903.9,16379.4,15420.3,17870.5,15912.8,13866.5,17823.2,17872,17420.4,16704.4,15991.2,16583.6,19123.5,17838.7,17209.4,18586.5,16258.1,15141.6,19202.1,17746.5,19090.1,18040.3,17515.5,17751.8,21072.4,17170,19439.5,19795.4,17574.9,16165.4,19464.6,19932.1,19961.2,17343.4,18924.2,18574.1,21350.6,18594.6,19823.1,20844.4,19640.2,17735.4,19813.6,22160,20664.3,17877.4,21211.2,21423.1,21688.7,23243.2,21490.2,22925.8,23184.8,18562.2) > par1 = '12' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa P., (2007), Mean Plot (v1.0.1) 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 > #Technical description: Write here your technical program description > par1 <- as.numeric(par1) > (n <- length(x)) [1] 92 > (np <- floor(n / par1)) [1] 7 > arr <- array(NA,dim=c(par1,np+1)) > ari <- array(0,dim=par1) > j <- 0 > for (i in 1:n) + { + j = j + 1 + ari[j] = ari[j] + 1 + arr[j,ari[j]] <- x[i] + if (j == par1) j = 0 + } > ari [1] 8 8 8 8 8 8 8 8 7 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 15044.5 14291.1 14768.9 14583.3 15991.2 17515.5 18924.2 21211.2 [2,] 14944.2 14205.3 14725.1 15305.8 16583.6 17751.8 18574.1 21423.1 [3,] 16754.8 15859.4 15998.1 17903.9 19123.5 21072.4 21350.6 21688.7 [4,] 14254.0 15258.9 15370.6 16379.4 17838.7 17170.0 18594.6 23243.2 [5,] 15454.9 15498.6 14956.9 15420.3 17209.4 19439.5 19823.1 21490.2 [6,] 15644.8 15106.5 15469.7 17870.5 18586.5 19795.4 20844.4 22925.8 [7,] 14568.3 15023.6 15101.8 15912.8 16258.1 17574.9 19640.2 23184.8 [8,] 12520.2 12083.0 11703.7 13866.5 15141.6 16165.4 17735.4 18562.2 [9,] 14803.0 15761.3 16283.6 17823.2 19202.1 19464.6 19813.6 NA [10,] 15873.2 16943.0 16726.5 17872.0 17746.5 19932.1 22160.0 NA [11,] 14755.3 15070.3 14968.9 17420.4 19090.1 19961.2 20664.3 NA [12,] 12875.1 13659.6 14861.0 16704.4 18040.3 17343.4 17877.4 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/www/html/rcomp/tmp/1wydw1229642698.ps",horizontal=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/www/html/rcomp/tmp/2w61p1229642698.ps",horizontal=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/www/html/rcomp/tmp/3u9x51229642698.ps",horizontal=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/www/html/rcomp/tmp/4aigx1229642698.ps",horizontal=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] [1,] 14291.10 14205.30 15859.40 14254.00 14956.9 15106.50 14568.30 11703.70 [2,] 14676.10 14834.65 16376.45 15314.75 15437.6 15557.25 15062.70 12301.60 [3,] 15517.85 15944.70 18513.70 16774.70 16354.0 18228.50 16085.45 14504.05 [4,] 18219.85 18162.95 21211.50 18216.65 19631.3 20319.90 18607.55 16950.40 [5,] 21211.20 21423.10 21688.70 18594.60 21490.2 22925.80 23184.80 18562.20 [,9] [,10] [,11] [,12] [1,] 14803.00 15873.20 14755.30 12875.1 [2,] 16022.45 16834.75 15019.60 14260.3 [3,] 17823.20 17746.50 17420.40 16704.4 [4,] 19333.35 18902.05 19525.65 17610.4 [5,] 19813.60 19932.10 20664.30 18040.3 $n [1] 8 8 8 8 8 8 8 8 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 13538.26 14085.46 15812.77 15153.66 14011.34 15568.02 14105.25 11907.16 [2,] 17497.44 17803.94 21214.63 18395.74 18696.66 20888.98 18065.65 17100.94 [,9] [,10] [,11] [,12] [1,] 15845.98 16511.94 14729.46 14703.77 [2,] 19800.42 18981.06 20111.34 18705.03 $out [1] 23243.2 22160.0 $group [1] 4 10 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(14291.1, 14676.1, 15517.85, 18219.85, 21211.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/528yo1229642698.ps",horizontal=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,] 12875.10 13659.60 14725.10 13866.50 15141.60 16165.40 17735.40 21211.20 [2,] 14411.15 14248.20 14814.95 15363.05 16420.85 17429.45 18584.35 21317.15 [3,] 14873.60 15088.40 15035.35 16541.90 17792.60 18595.65 19726.90 21589.45 [4,] 15549.85 15629.95 15733.90 17846.85 18838.30 19863.75 20754.35 23055.30 [5,] 16754.80 16943.00 16726.50 17903.90 19202.10 21072.40 22160.00 23243.20 $n [1] 12 12 12 12 12 12 12 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 14354.23 14458.17 14616.21 15409.02 16689.98 17485.35 18737.15 20618.49 [2,] 15392.97 15718.63 15454.49 17674.78 18895.22 19705.95 20716.65 22560.41 $out [1] 12520.2 12083.0 11703.7 18562.2 $group [1] 1 2 3 8 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(12875.1, 14411.15, 14873.6, 15549.85, 16754.8, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/62grj1229642698.ps",horizontal=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,] 14722.25 14504.05 14484.40 [2,] 16615.18 16015.08 16359.24 [3,] 17337.64 16739.55 16978.90 [4,] 17886.05 17784.85 17753.62 [5,] 18718.92 18513.70 18853.79 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 16757.99 15932.34 16342.92 [2,] 17917.30 17546.76 17614.88 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(14722.25, 16615.18125, 17337.64375, 17886.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1wydw1229642698.ps tmp/1wydw1229642698.png") > system("convert tmp/2w61p1229642698.ps tmp/2w61p1229642698.png") > system("convert tmp/3u9x51229642698.ps tmp/3u9x51229642698.png") > system("convert tmp/4aigx1229642698.ps tmp/4aigx1229642698.png") > system("convert tmp/528yo1229642698.ps tmp/528yo1229642698.png") > system("convert tmp/62grj1229642698.ps tmp/62grj1229642698.png") > > > proc.time() user system elapsed 1.192 0.917 1.880