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(0.95,0.98,1.23,1.17,0.84,0.74,0.65,0.91,1.19,1.30,1.53,1.94,1.79,1.95,2.26,2.04,2.16,2.75,2.79,2.88,3.36,2.97,3.10,2.49,2.20,2.25,2.09,2.79,3.14,2.93,2.65,2.67,2.26,2.35,2.13,2.18,2.90,2.63,2.67,1.81,1.33,0.88,1.28,1.26,1.26,1.29,1.10,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,2.24,2.94,3.09,3.46,3.64,4.39,4.15,5.21,5.80,5.91) > par1 = '12' > x <- x[x>quantile(x,0.05) & x #'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] 103 > (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 9 9 9 9 9 9 8 8 8 8 8 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.98 2.75 2.93 1.28 1.49 2.41 3.14 1.60 1.37 [2,] 1.23 2.79 2.65 1.26 1.79 2.26 3.11 1.63 1.12 [3,] 1.17 2.88 2.67 1.26 1.80 2.03 3.16 1.22 1.51 [4,] 1.19 3.36 2.26 1.29 1.58 2.86 2.47 1.21 2.24 [5,] 1.30 2.97 2.35 1.10 1.86 2.55 2.57 1.49 2.94 [6,] 1.53 3.10 2.13 1.37 1.74 2.27 2.89 1.64 3.09 [7,] 1.94 2.49 2.18 1.21 1.59 2.26 2.63 1.66 3.46 [8,] 1.79 2.20 2.90 1.74 1.26 2.57 2.38 1.77 NA [9,] 1.95 2.25 2.63 1.76 1.13 3.07 1.69 1.82 NA [10,] 2.26 2.09 2.67 1.48 1.92 2.76 1.96 1.78 NA [11,] 2.04 2.79 1.81 1.04 2.61 2.51 2.19 1.28 NA [12,] 2.16 3.14 1.33 1.62 2.26 2.87 1.87 1.29 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/1mzed1225390715.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/2uip41225390715.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/3pcdo1225390715.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/4ts831225390715.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,] 0.98 1.12 1.17 1.19 1.10 1.37 1.21 1.260 1.130 1.480 1.040 1.290 [2,] 1.37 1.26 1.26 1.29 1.49 1.64 1.66 1.755 1.725 1.850 1.545 1.475 [3,] 1.60 1.79 1.80 2.24 2.35 2.13 2.18 1.995 1.885 2.025 2.115 2.015 [4,] 2.75 2.65 2.67 2.47 2.57 2.89 2.49 2.475 2.440 2.465 2.560 2.565 [5,] 3.14 3.11 3.16 3.36 2.97 3.10 3.46 2.900 3.070 2.760 2.790 3.140 $n [1] 9 9 9 9 9 9 9 8 8 8 8 8 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.8732 1.057933 1.0574 1.618533 1.7812 1.471667 1.742867 1.592798 1.485591 [2,] 2.3268 2.522067 2.5426 2.861467 2.9188 2.788333 2.617133 2.397202 2.284409 [,10] [,11] [,12] [1,] 1.681452 1.548006 1.406110 [2,] 2.368548 2.681994 2.623890 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" Warning message: In bxp(list(stats = c(0.98, 1.37, 1.6, 2.75, 3.14, 1.12, 1.26, 1.79, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/56a9h1225390715.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,] 0.980 2.090 1.810 1.040 1.130 2.030 1.690 1.210 1.120 [2,] 1.210 2.370 2.155 1.235 1.535 2.265 2.075 1.285 1.440 [3,] 1.660 2.790 2.490 1.285 1.765 2.530 2.520 1.615 2.240 [4,] 1.995 3.035 2.670 1.550 1.890 2.810 3.000 1.715 3.015 [5,] 2.260 3.360 2.930 1.760 2.260 3.070 3.160 1.820 3.460 $n [1] 12 12 12 12 12 12 12 12 7 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1.301956 2.486689 2.255105 1.141326 1.603082 2.281422 2.098101 1.418874 [2,] 2.018044 3.093311 2.724895 1.428674 1.926918 2.778578 2.941899 1.811126 [,9] [1,] 1.299435 [2,] 3.180565 $out [1] 1.33 2.61 $group [1] 3 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" NA Warning message: In bxp(list(stats = c(0.98, 1.21, 1.66, 1.995, 2.26, 2.09, 2.37, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6pqfe1225390715.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,] 1.966667 1.6000 1.880000 [2,] 2.014097 1.8425 1.972500 [3,] 2.059306 2.0200 2.051875 [4,] 2.120278 2.1550 2.100625 [5,] 2.195556 2.3500 2.265000 $n [1] 12 12 12 $conf [,1] [,2] [,3] [1,] 2.010876 1.877467 1.993436 [2,] 2.107735 2.162533 2.110314 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(1.96666666666667, 2.01409722222222, 2.05930555555556, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1mzed1225390715.ps tmp/1mzed1225390715.png") > system("convert tmp/2uip41225390715.ps tmp/2uip41225390715.png") > system("convert tmp/3pcdo1225390715.ps tmp/3pcdo1225390715.png") > system("convert tmp/4ts831225390715.ps tmp/4ts831225390715.png") > system("convert tmp/56a9h1225390715.ps tmp/56a9h1225390715.png") > system("convert tmp/6pqfe1225390715.ps tmp/6pqfe1225390715.png") > > > proc.time() user system elapsed 1.243 0.813 1.523