R version 2.7.2 (2008-08-25) 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(3467.9,3256.6,3711.1,3597.7,4181.1,4346.5,3646.6,3918.8,3531.8,3976,3510.2,3882.9,3630.4,3519.9,3376.1,3057.9,3646.7,3585.5,3007.7,3545,3295.6,3390.3,3531.9,3738.7,3477,3338.3,3264.4,3452.4,4045.1,3660.5,3584.9,3819.9,3409.2,3643.5,3673.3,3645.2,3421.3,3531.4,3219.2,3552.3,3787.7,3392.7,3550,3681.9,3519.1,4283.2,4046.2,3824.9,4793.1,3977.7,3983.4,4152.9,4286.1,4348.1,3949.3,4166.7,4217.9,4528.2,4232.2,4470.9,5121.2,4170.8,4398.6,4491.4,4251.8,4901.9,4745.2,4666.9,4210.4,5273.6,4095.3,4610.1,4718.1,4185.5,4314.7,4422.6,5059.2,5043.6,4436.6,4922.6,4454.8,5058.7,4768.9,5171.8,4989.3,5202.1,4838.4,4876.5,5845.3,5686.3,4753.8,6620.4,5597.2,5643.5,6357.3,5909.1,6165.8) > 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] 97 > (np <- floor(n / par1)) [1] 8 > 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] 9 8 8 8 8 8 8 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 3467.9 3630.4 3477.0 3421.3 4793.1 5121.2 4718.1 4989.3 6165.8 [2,] 3256.6 3519.9 3338.3 3531.4 3977.7 4170.8 4185.5 5202.1 NA [3,] 3711.1 3376.1 3264.4 3219.2 3983.4 4398.6 4314.7 4838.4 NA [4,] 3597.7 3057.9 3452.4 3552.3 4152.9 4491.4 4422.6 4876.5 NA [5,] 4181.1 3646.7 4045.1 3787.7 4286.1 4251.8 5059.2 5845.3 NA [6,] 4346.5 3585.5 3660.5 3392.7 4348.1 4901.9 5043.6 5686.3 NA [7,] 3646.6 3007.7 3584.9 3550.0 3949.3 4745.2 4436.6 4753.8 NA [8,] 3918.8 3545.0 3819.9 3681.9 4166.7 4666.9 4922.6 6620.4 NA [9,] 3531.8 3295.6 3409.2 3519.1 4217.9 4210.4 4454.8 5597.2 NA [10,] 3976.0 3390.3 3643.5 4283.2 4528.2 5273.6 5058.7 5643.5 NA [11,] 3510.2 3531.9 3673.3 4046.2 4232.2 4095.3 4768.9 6357.3 NA [12,] 3882.9 3738.7 3645.2 3824.9 4470.9 4610.1 5171.8 5909.1 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/11jm91225388805.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/2h1p21225388805.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/3mp6f1225388805.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/4d35g1225388805.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] [,9] [1,] 3421.3 3256.60 3219.20 3057.90 3646.70 3392.70 3007.70 3545.00 3295.60 [2,] 3477.0 3429.10 3320.25 3502.35 3916.40 3623.00 3567.45 3750.90 3464.15 [3,] 4718.1 3754.55 3847.25 3875.30 4216.45 4347.30 3797.95 4042.75 3871.10 [4,] 4989.3 4178.15 4356.65 4457.00 4672.65 4972.75 4590.90 4794.75 4336.35 [5,] 6165.8 5202.10 4838.40 4876.50 5059.20 5686.30 4753.80 4922.60 5597.20 [,10] [,11] [,12] [1,] 3390.30 3510.20 3645.20 [2,] 3809.75 3602.60 3781.80 [3,] 4405.70 4070.75 4176.90 [4,] 5166.15 4500.55 4890.95 [5,] 5643.50 4768.90 5909.10 $n [1] 9 8 8 8 8 8 8 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 3921.622 3336.12 3268.302 3342.019 3793.998 3593.31 3226.236 3459.640 [2,] 5514.578 4172.98 4426.198 4408.581 4638.902 5101.29 4369.664 4625.860 [,9] [,10] [,11] [,12] [1,] 3383.877 3647.995 3569.142 3557.313 [2,] 4358.323 5163.405 4572.358 4796.487 $out [1] 5845.3 6620.4 6357.3 $group [1] 5 8 11 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(3421.3, 3477, 4718.1, 4989.3, 6165.8, 3256.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5f4m41225388805.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] [,9] [1,] 3256.60 3007.70 3264.4 3219.20 3949.30 4095.30 4185.50 4753.80 6165.8 [2,] 3521.00 3335.85 3430.8 3470.20 4068.15 4231.10 4429.60 4932.90 6165.8 [3,] 3678.85 3525.90 3614.2 3551.15 4225.05 4550.75 4743.50 5620.35 6165.8 [4,] 3947.40 3607.95 3666.9 3806.30 4409.50 4823.55 5051.15 5877.20 6165.8 [5,] 4346.50 3738.70 3819.9 4283.20 4793.10 5273.60 5171.80 6620.40 6165.8 $n [1] 12 12 12 12 12 12 12 12 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 3484.366 3401.793 3506.513 3397.853 4069.358 4280.53 4460.007 5189.648 [2,] 3873.334 3650.007 3721.887 3704.447 4380.742 4820.97 5026.993 6051.052 [,9] [1,] 6165.8 [2,] 6165.8 $out [1] 4045.1 $group [1] 3 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(3256.6, 3521, 3678.85, 3947.4, 4346.5, 3007.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/61ft71225388805.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,] 3888.238 3754.550 3824.488 [2,] 3954.863 3859.175 3933.969 [3,] 4323.775 4056.750 4137.512 [4,] 4412.237 4281.875 4267.525 [5,] 4474.625 4718.100 4502.650 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 4115.163 3863.954 3985.375 [2,] 4532.387 4249.546 4289.650 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(3888.2375, 3954.8625, 4323.775, 4412.2375, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/11jm91225388805.ps tmp/11jm91225388805.png") > system("convert tmp/2h1p21225388805.ps tmp/2h1p21225388805.png") > system("convert tmp/3mp6f1225388805.ps tmp/3mp6f1225388805.png") > system("convert tmp/4d35g1225388805.ps tmp/4d35g1225388805.png") > system("convert tmp/5f4m41225388805.ps tmp/5f4m41225388805.png") > system("convert tmp/61ft71225388805.ps tmp/61ft71225388805.png") > > > proc.time() user system elapsed 1.299 0.856 3.465