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(3755.3,3001.4,3815.7,4034.4,3590.4,4176.4,3943.5,3934.2,3859.2,3300.5,3800.0,3958.7,3451.4,2678.6,3279.3,3550.3,3294.4,3202.2,3486.4,3139.7,3283.2,2933.6,3391.6,3301.3,3257.6,2537.0,2970.5,3481.9,3361.1,3123.2,3843.3,3153.0,3365.1,3528.5,3506.7,3146.6,3195.1,2424.0,2676.3,3174.6,3067.4,3121.2,3517.7,3014.7,2949.6,2990.3,3084.1,3077.9,3023.6,2226.2,2628.3,3088.7,2551.4,2856.7,3176.2,2663.1,2630.4,2584.4,2472.2,2895.6) > par1 = '36' > #'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] 60 > (np <- floor(n / par1)) [1] 1 > 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] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 > arr [,1] [,2] [1,] 3755.3 3195.1 [2,] 3001.4 2424.0 [3,] 3815.7 2676.3 [4,] 4034.4 3174.6 [5,] 3590.4 3067.4 [6,] 4176.4 3121.2 [7,] 3943.5 3517.7 [8,] 3934.2 3014.7 [9,] 3859.2 2949.6 [10,] 3300.5 2990.3 [11,] 3800.0 3084.1 [12,] 3958.7 3077.9 [13,] 3451.4 3023.6 [14,] 2678.6 2226.2 [15,] 3279.3 2628.3 [16,] 3550.3 3088.7 [17,] 3294.4 2551.4 [18,] 3202.2 2856.7 [19,] 3486.4 3176.2 [20,] 3139.7 2663.1 [21,] 3283.2 2630.4 [22,] 2933.6 2584.4 [23,] 3391.6 2472.2 [24,] 3301.3 2895.6 [25,] 3257.6 NA [26,] 2537.0 NA [27,] 2970.5 NA [28,] 3481.9 NA [29,] 3361.1 NA [30,] 3123.2 NA [31,] 3843.3 NA [32,] 3153.0 NA [33,] 3365.1 NA [34,] 3528.5 NA [35,] 3506.7 NA [36,] 3146.6 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/1pucu1229886879.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/2w7o71229886880.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/3n9r31229886880.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/4exoq1229886880.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] [,10] [1,] 3195.1 2424.0 2676.3 3174.6 3067.4 3121.2 3517.7 3014.70 2949.6 2990.3 [2,] 3195.1 2424.0 2676.3 3174.6 3067.4 3121.2 3517.7 3014.70 2949.6 2990.3 [3,] 3475.2 2712.7 3246.0 3604.5 3328.9 3648.8 3730.6 3474.45 3404.4 3145.4 [4,] 3755.3 3001.4 3815.7 4034.4 3590.4 4176.4 3943.5 3934.20 3859.2 3300.5 [5,] 3755.3 3001.4 3815.7 4034.4 3590.4 4176.4 3943.5 3934.20 3859.2 3300.5 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 3084.10 3077.9 3023.6 2226.2 2628.3 3088.7 2551.4 2856.70 3176.2 2663.1 [2,] 3084.10 3077.9 3023.6 2226.2 2628.3 3088.7 2551.4 2856.70 3176.2 2663.1 [3,] 3442.05 3518.3 3237.5 2452.4 2953.8 3319.5 2922.9 3029.45 3331.3 2901.4 [4,] 3800.00 3958.7 3451.4 2678.6 3279.3 3550.3 3294.4 3202.20 3486.4 3139.7 [5,] 3800.00 3958.7 3451.4 2678.6 3279.3 3550.3 3294.4 3202.20 3486.4 3139.7 [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [1,] 2630.4 2584.4 2472.2 2895.60 3257.6 2537 2970.5 3481.9 3361.1 3123.2 [2,] 2630.4 2584.4 2472.2 2895.60 3257.6 2537 2970.5 3481.9 3361.1 3123.2 [3,] 2956.8 2759.0 2931.9 3098.45 3257.6 2537 2970.5 3481.9 3361.1 3123.2 [4,] 3283.2 2933.6 3391.6 3301.30 3257.6 2537 2970.5 3481.9 3361.1 3123.2 [5,] 3283.2 2933.6 3391.6 3301.30 3257.6 2537 2970.5 3481.9 3361.1 3123.2 [,31] [,32] [,33] [,34] [,35] [,36] [1,] 3843.3 3153 3365.1 3528.5 3506.7 3146.6 [2,] 3843.3 3153 3365.1 3528.5 3506.7 3146.6 [3,] 3843.3 3153 3365.1 3528.5 3506.7 3146.6 [4,] 3843.3 3153 3365.1 3528.5 3506.7 3146.6 [5,] 3843.3 3153 3365.1 3528.5 3506.7 3146.6 $n [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2849.328 2067.612 1973.030 2643.907 2744.589 2469.900 3254.884 2447.158 [2,] 4101.072 3357.788 4518.970 4565.093 3913.211 4827.700 4206.316 4501.742 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [1,] 2388.169 2798.836 2642.226 2534.245 2759.550 1946.966 2226.484 2803.787 [2,] 4420.631 3491.964 4241.874 4502.355 3715.450 2957.834 3681.116 3835.213 [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 2092.799 2643.447 2984.736 2368.929 2227.473 2368.864 1904.72 2645.190 [2,] 3753.001 3415.453 3677.864 3433.871 3686.127 3149.136 3959.08 3551.710 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [1,] 3257.6 2537 2970.5 3481.9 3361.1 3123.2 3843.3 3153 3365.1 3528.5 3506.7 [2,] 3257.6 2537 2970.5 3481.9 3361.1 3123.2 3843.3 3153 3365.1 3528.5 3506.7 [,36] [1,] 3146.6 [2,] 3146.6 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" Warning message: In bxp(list(stats = c(3195.1, 3195.1, 3475.2, 3755.3, 3755.3, 2424, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5bc691229886880.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] [1,] 2537.00 2226.20 [2,] 3177.60 2629.35 [3,] 3378.35 2969.95 [4,] 3777.65 3086.40 [5,] 4176.40 3517.70 $n [1] 36 24 $conf [,1] [,2] [1,] 3220.337 2822.544 [2,] 3536.363 3117.356 $out numeric(0) $group numeric(0) $names [1] "1" NA Warning message: In bxp(list(stats = c(2537, 3177.6, 3378.35, 3777.65, 4176.4, 2226.2, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6s0001229886880.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,] 2452.400 2452.400 2452.400 [2,] 2963.650 2963.650 2963.650 [3,] 3251.800 3251.800 3251.800 [4,] 3474.825 3474.825 3474.825 [5,] 3843.300 3843.300 3843.300 $n [1] 36 36 36 $conf [,1] [,2] [,3] [1,] 3117.191 3117.191 3117.191 [2,] 3386.409 3386.409 3386.409 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > system("convert tmp/1pucu1229886879.ps tmp/1pucu1229886879.png") > system("convert tmp/2w7o71229886880.ps tmp/2w7o71229886880.png") > system("convert tmp/3n9r31229886880.ps tmp/3n9r31229886880.png") > system("convert tmp/4exoq1229886880.ps tmp/4exoq1229886880.png") > system("convert tmp/5bc691229886880.ps tmp/5bc691229886880.png") > system("convert tmp/6s0001229886880.ps tmp/6s0001229886880.png") > > > proc.time() user system elapsed 1.148 0.879 1.393