R version 2.5.1 (2007-06-27) Copyright (C) 2007 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(1.79,1.95,2.26,2.04,2.16,2.75,2.79,2.88,3.36,2.97,3.1,2.49,2.2,2.25,2.09,2.79,3.14,2.93,2.65,2.67,2.26,2.35,2.13,2.18,2.9,2.63,2.67,1.81,1.33,0.88,1.28,1.26,1.26,1.29,1.1,1.37,1.21,1.74,1.76,1.48,1.04,1.62,1.49,1.79,1.8,1.58,1.86,1.74,1.59,1.26,1.13,1.92,2.61,2.26,2.41,2.26,2.03,2.86,2.55,2.27,2.26,2.57,3.07,2.76,2.51,2.87,3.14,3.11,3.16,2.47,2.57,2.89,2.63,2.38,1.69,1.96,2.19,1.87,1.6,1.63,1.22,1.21,1.49,1.64,1.66,1.77,1.82,1.78,1.28,1.29,1.37,1.12,1.51) > 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] 93 > (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 8 7 7 7 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.79 2.20 2.90 1.21 1.59 2.26 2.63 1.66 [2,] 1.95 2.25 2.63 1.74 1.26 2.57 2.38 1.77 [3,] 2.26 2.09 2.67 1.76 1.13 3.07 1.69 1.82 [4,] 2.04 2.79 1.81 1.48 1.92 2.76 1.96 1.78 [5,] 2.16 3.14 1.33 1.04 2.61 2.51 2.19 1.28 [6,] 2.75 2.93 0.88 1.62 2.26 2.87 1.87 1.29 [7,] 2.79 2.65 1.28 1.49 2.41 3.14 1.60 1.37 [8,] 2.88 2.67 1.26 1.79 2.26 3.11 1.63 1.12 [9,] 3.36 2.26 1.26 1.80 2.03 3.16 1.22 1.51 [10,] 2.97 2.35 1.29 1.58 2.86 2.47 1.21 NA [11,] 3.10 2.13 1.10 1.86 2.55 2.57 1.49 NA [12,] 2.49 2.18 1.37 1.74 2.27 2.89 1.64 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/145ka1193401565.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/20zw31193401565.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/3cozo1193401565.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/4qdhv1193401565.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] [,11] [,12] [1,] 1.210 1.260 1.130 1.480 1.040 0.880 1.280 1.120 1.220 1.210 1.100 1.37 [2,] 1.625 1.755 1.725 1.795 1.305 1.455 1.430 1.445 1.385 1.435 1.675 1.69 [3,] 1.995 2.100 1.955 1.940 2.175 2.065 2.005 2.025 1.915 2.350 2.130 2.18 [4,] 2.445 2.475 2.465 2.400 2.560 2.810 2.720 2.775 2.710 2.665 2.560 2.38 [5,] 2.900 2.630 3.070 2.790 3.140 2.930 3.140 3.110 3.360 2.970 3.100 2.89 $n [1] 8 8 8 8 8 8 8 8 8 7 7 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.536936 1.697798 1.541625 1.602038 1.473939 1.308078 1.284387 1.282043 [2,] 2.453064 2.502202 2.368375 2.277962 2.876061 2.821922 2.725613 2.767957 [,9] [,10] [,11] [,12] [1,] 1.174836 1.615464 1.601492 1.767943 [2,] 2.655164 3.084536 2.658508 2.592057 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: some notches went outside hinges ('box'): maybe set notch=FALSE in: bxp(list(stats = c(1.21, 1.625, 1.995, 2.445, 2.9, 1.26, 1.755, > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/571tl1193401565.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,] 1.790 2.090 0.88 1.210 1.130 2.260 1.210 1.12 [2,] 2.100 2.190 1.26 1.485 1.755 2.540 1.545 1.29 [3,] 2.620 2.305 1.31 1.680 2.260 2.815 1.665 1.51 [4,] 2.925 2.730 2.22 1.775 2.480 3.090 2.075 1.77 [5,] 3.360 3.140 2.90 1.860 2.860 3.160 2.630 1.82 $n [1] 12 12 12 12 12 12 12 9 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 2.243712 2.058702 0.8721376 1.547729 1.929323 2.564141 1.423263 1.2572 [2,] 2.996288 2.551298 1.7478624 1.812271 2.590677 3.065859 1.906737 1.7628 $out [1] 1.04 $group [1] 4 $names [1] "1" "2" "3" "4" "5" "6" "7" NA Warning message: some notches went outside hinges ('box'): maybe set notch=FALSE in: bxp(list(stats = c(1.79, 2.1, 2.62, 2.925, 3.36, 2.09, 2.19, > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6htt81193401565.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,] 2.030000 1.9150 1.926250 [2,] 2.060000 1.9750 2.004375 [3,] 2.071875 2.0450 2.051250 [4,] 2.090625 2.1525 2.106250 [5,] 2.114286 2.3500 2.158750 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.057907 1.964041 2.004784 [2,] 2.085843 2.125959 2.097716 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: some notches went outside hinges ('box'): maybe set notch=FALSE in: bxp(list(stats = c(2.03, 2.06, 2.071875, 2.090625, 2.11428571428571, > dev.off() null device 1 > > system("convert tmp/145ka1193401565.ps tmp/145ka1193401565.png") > system("convert tmp/20zw31193401565.ps tmp/20zw31193401565.png") > system("convert tmp/3cozo1193401565.ps tmp/3cozo1193401565.png") > system("convert tmp/4qdhv1193401565.ps tmp/4qdhv1193401565.png") > system("convert tmp/571tl1193401565.ps tmp/571tl1193401565.png") > system("convert tmp/6htt81193401565.ps tmp/6htt81193401565.png") > > > proc.time() user system elapsed 1.361 0.823 1.596