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(82.7,88.9,105.9,100.8,94,105,58.5,87.6,113.1,112.5,89.6,74.5,82.7,90.1,109.4,96,89.2,109.1,49.1,92.9,107.7,103.5,91.1,79.8,71.9,82.9,90.1,100.7,90.7,108.8,44.1,93.6,107.4,96.5,93.6,76.5,76.7,84.0,103.3,88.5,99.0,105.9,44.7,94.0,107.1,104.8,102.5,77.7,85.2,91.3,106.5,92.4,97.5,107,51.1,98.6,102.2,114.3,99.4,72.5,92.3,99.4,85.9,109.4,97.6) > par1 = '15' > #'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] 65 > (np <- floor(n / par1)) [1] 4 > 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] 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 > arr [,1] [,2] [,3] [,4] [,5] [1,] 82.7 96.0 44.1 104.8 92.3 [2,] 88.9 89.2 93.6 102.5 99.4 [3,] 105.9 109.1 107.4 77.7 85.9 [4,] 100.8 49.1 96.5 85.2 109.4 [5,] 94.0 92.9 93.6 91.3 97.6 [6,] 105.0 107.7 76.5 106.5 NA [7,] 58.5 103.5 76.7 92.4 NA [8,] 87.6 91.1 84.0 97.5 NA [9,] 113.1 79.8 103.3 107.0 NA [10,] 112.5 71.9 88.5 51.1 NA [11,] 89.6 82.9 99.0 98.6 NA [12,] 74.5 90.1 105.9 102.2 NA [13,] 82.7 100.7 44.7 114.3 NA [14,] 90.1 90.7 94.0 99.4 NA [15,] 109.4 108.8 107.1 72.5 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/1rx1r1225415063.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/2vcdn1225415063.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/36ual1225415063.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/4xne31225415063.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,] 82.7 88.9 77.7 85.2 91.3 76.50 58.50 84.00 79.80 51.1 82.90 74.50 [2,] 82.7 89.2 85.9 85.2 92.9 90.75 67.60 85.80 91.55 61.5 86.25 82.30 [3,] 92.3 93.6 105.9 96.5 93.6 105.75 84.55 89.35 105.15 80.2 94.10 96.15 [4,] 96.0 99.4 107.4 100.8 94.0 107.10 97.95 94.30 110.05 100.5 98.80 104.05 [5,] 104.8 102.5 109.1 109.4 94.0 107.70 103.50 97.50 113.10 112.5 99.00 105.90 [,13] [,14] [,15] [1,] 44.7 90.10 72.50 [2,] 63.7 90.40 89.80 [3,] 91.7 92.35 107.95 [4,] 107.5 96.70 109.10 [5,] 114.3 99.40 109.40 $n [1] 5 5 5 5 5 4 4 4 4 4 4 4 4 4 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 82.90225 86.3927 90.70815 85.47708 92.82274 92.8335 60.5735 82.635 [2,] 101.69775 100.8073 121.09185 107.52292 94.37726 118.6665 108.5265 96.065 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [1,] 90.535 49.39 84.1855 78.9675 57.098 87.373 92.703 [2,] 119.765 111.01 104.0145 113.3325 126.302 97.327 123.197 $out [1] 44.1 49.1 97.6 $group [1] 1 4 5 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" Warning message: In bxp(list(stats = c(82.7, 82.7, 92.3, 96, 104.8, 88.9, 89.2, 93.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5n3tf1225415063.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] [1,] 58.50 71.90 76.50 72.50 85.9 [2,] 85.15 86.05 80.35 88.25 92.3 [3,] 90.10 91.10 93.60 98.60 97.6 [4,] 105.45 102.10 101.15 103.65 99.4 [5,] 113.10 109.10 107.40 114.30 109.4 $n [1] 15 15 15 15 5 $conf [,1] [,2] [,3] [,4] [,5] [1,] 81.81853 84.55233 85.11455 92.3175 92.58316 [2,] 98.38147 97.64767 102.08545 104.8825 102.61684 $out [1] 49.1 44.1 44.7 51.1 $group [1] 2 3 3 4 $names [1] "1" "2" "3" "4" NA Warning message: In bxp(list(stats = c(58.5, 85.15, 90.1, 105.45, 113.1, 71.9, 86.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6ecwp1225415063.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,] 81.000 80.200 80.60000 [2,] 86.900 92.000 89.52500 [3,] 93.175 93.600 93.31250 [4,] 95.960 100.825 95.65625 [5,] 100.800 107.950 103.70000 $n [1] 15 15 15 $conf [,1] [,2] [,3] [1,] 89.47893 89.9998 90.81123 [2,] 96.87107 97.2002 95.81377 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(81, 86.9, 93.175, 95.96, 100.8, 80.2, 92, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1rx1r1225415063.ps tmp/1rx1r1225415063.png") > system("convert tmp/2vcdn1225415063.ps tmp/2vcdn1225415063.png") > system("convert tmp/36ual1225415063.ps tmp/36ual1225415063.png") > system("convert tmp/4xne31225415063.ps tmp/4xne31225415063.png") > system("convert tmp/5n3tf1225415063.ps tmp/5n3tf1225415063.png") > system("convert tmp/6ecwp1225415063.ps tmp/6ecwp1225415063.png") > > > proc.time() user system elapsed 1.266 0.805 3.119