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(18562.2,23184.8,22925.8,21490.2,23243.2,21688.7,21423.1,21211.2,17877.4,20664.3,22160.0,19813.6,17735.4,19640.2,20844.4,19823.1,18594.6,21350.6,18574.1,18924.2,17343.4,19961.2,19932.1,19464.6,16165.4,17574.9,19795.4,19439.5,17170.0,21072.4,17751.8,17515.5,18040.3,19090.1,17746.5,19202.1,15141.6,16258.1,18586.5,17209.4,17838.7,19123.5,16583.6,15991.2,16704.4,17420.4,17872.0,17823.2,13866.5,15912.8,17870.5,15420.3,16379.4,17903.9,15305.8,14583.3,14861.0,14968.9,16726.5,16283.6,11703.7,15101.8,15469.7,14956.9,15370.6,15998.1,14725.1,14768.9,13659.6,15070.3,16943.0,15761.3,12083.0,15023.6,15106.5,15498.6,15258.9,15859.4,14205.3,14291.1,12875.1,14755.3,15873.2,14803.0,12520.2,14568.3,15644.8,15454.9,14254.0,16754.8,14944.2,15044.5) > 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,] 18562.2 17735.4 16165.4 15141.6 13866.5 11703.7 12083.0 12520.2 [2,] 23184.8 19640.2 17574.9 16258.1 15912.8 15101.8 15023.6 14568.3 [3,] 22925.8 20844.4 19795.4 18586.5 17870.5 15469.7 15106.5 15644.8 [4,] 21490.2 19823.1 19439.5 17209.4 15420.3 14956.9 15498.6 15454.9 [5,] 23243.2 18594.6 17170.0 17838.7 16379.4 15370.6 15258.9 14254.0 [6,] 21688.7 21350.6 21072.4 19123.5 17903.9 15998.1 15859.4 16754.8 [7,] 21423.1 18574.1 17751.8 16583.6 15305.8 14725.1 14205.3 14944.2 [8,] 21211.2 18924.2 17515.5 15991.2 14583.3 14768.9 14291.1 15044.5 [9,] 17877.4 17343.4 18040.3 16704.4 14861.0 13659.6 12875.1 NA [10,] 20664.3 19961.2 19090.1 17420.4 14968.9 15070.3 14755.3 NA [11,] 22160.0 19932.1 17746.5 17872.0 16726.5 16943.0 15873.2 NA [12,] 19813.6 19464.6 19202.1 17823.2 16283.6 15761.3 14803.0 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/1a1jy1228921424.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/2cbw11228921424.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/3bg4u1228921424.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/4ip5v1228921424.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,] 11703.70 14568.30 15106.50 14956.9 14254.00 15859.40 14205.30 14291.10 [2,] 12301.60 15062.70 15557.25 15437.6 15314.75 16376.45 14834.65 14676.10 [3,] 14504.05 16085.45 18228.50 16354.0 16774.70 18513.70 15944.70 15517.85 [4,] 16950.40 18607.55 20319.90 19631.3 18216.65 21211.50 18162.95 18219.85 [5,] 18562.20 23184.80 22925.80 21490.2 18594.60 21688.70 21423.10 21211.20 [,9] [,10] [,11] [,12] [1,] 12875.1 14755.30 15873.20 14803.00 [2,] 14260.3 15019.60 16834.75 16022.45 [3,] 16704.4 17420.40 17746.50 17823.20 [4,] 17610.4 19525.65 18902.05 19333.35 [5,] 18040.3 20664.30 19932.10 19813.60 $n [1] 8 8 8 8 8 8 8 8 7 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 11907.16 14105.25 15568.02 14011.34 15153.66 15812.77 14085.46 13538.26 [2,] 17100.94 18065.65 20888.98 18696.66 18395.74 21214.63 17803.94 17497.44 [,9] [,10] [,11] [,12] [1,] 14703.77 14729.46 16511.94 15845.98 [2,] 18705.03 20111.34 18981.06 19800.42 $out [1] 23243.2 22160.0 $group [1] 5 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(11703.7, 12301.6, 14504.05, 16950.4, 18562.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5puhv1228921424.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,] 17877.40 17343.40 16165.40 15141.60 13866.50 13659.60 12875.10 14254.00 [2,] 20238.95 18584.35 17545.20 16420.85 14914.95 14747.00 14248.20 14411.15 [3,] 21456.65 19552.40 17896.05 17314.90 15666.55 15086.05 14913.30 14994.35 [4,] 22542.90 19946.65 19320.80 17855.35 16552.95 15615.50 15378.75 15549.85 [5,] 23243.20 21350.60 21072.40 19123.50 17903.90 15998.10 15873.20 16754.80 $n [1] 12 12 12 12 12 12 12 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 20405.80 18931.05 17086.19 16660.61 14919.45 14689.92 14397.65 14358.26 [2,] 22507.50 20173.75 18705.91 17969.19 16413.65 15482.18 15428.95 15630.44 $out [1] 11703.7 16943.0 12083.0 12520.2 $group [1] 6 6 7 8 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: In bxp(list(stats = c(17877.4, 20238.95, 21456.65, 22542.9, 23243.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/68oiy1228921424.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/1a1jy1228921424.ps tmp/1a1jy1228921424.png") > system("convert tmp/2cbw11228921424.ps tmp/2cbw11228921424.png") > system("convert tmp/3bg4u1228921424.ps tmp/3bg4u1228921424.png") > system("convert tmp/4ip5v1228921424.ps tmp/4ip5v1228921424.png") > system("convert tmp/5puhv1228921424.ps tmp/5puhv1228921424.png") > system("convert tmp/68oiy1228921424.ps tmp/68oiy1228921424.png") > > > proc.time() user system elapsed 1.075 0.825 1.341