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(109.20,88.60,94.30,98.30,86.40,80.60,104.10,108.20,93.40,71.90,94.10,94.90,96.40,91.10,84.40,86.40,88.00,75.10,109.70,103.00,82.10,68.00,96.40,94.30,90.00,88.00,76.10,82.50,81.40,66.50,97.20,94.10,80.70,70.50,87.80,89.50,99.60,84.20,75.10,92.00,80.80,73.10,99.80,90.00,83.10,72.40,78.80,87.30,91.00,80.10,73.60,86.40,74.50,71.20,92.40,81.50,85.30,69.90,84.20,90.70,100.30) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = '' > par3 = '' > par2 = '' > par1 = '5' > ylab = '' > xlab = '' > main = '' > #'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] 61 > (np <- floor(n / par1)) [1] 12 > 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] 13 12 12 12 12 > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 109.2 80.6 94.1 86.4 82.1 88.0 97.2 89.5 80.8 72.4 73.6 81.5 100.3 [2,] 88.6 104.1 94.9 88.0 68.0 76.1 94.1 99.6 73.1 78.8 86.4 85.3 NA [3,] 94.3 108.2 96.4 75.1 96.4 82.5 80.7 84.2 99.8 87.3 74.5 69.9 NA [4,] 98.3 93.4 91.1 109.7 94.3 81.4 70.5 75.1 90.0 91.0 71.2 84.2 NA [5,] 86.4 71.9 84.4 103.0 90.0 66.5 87.8 92.0 83.1 80.1 92.4 90.7 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/1vwu91225746312.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/20nck1225746312.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/3mie81225746312.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/4r35o1225746312.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] [1,] 72.4 68.00 69.90 70.50 71.90 [2,] 80.8 77.45 77.90 78.25 81.60 [3,] 86.4 87.20 85.75 90.50 87.10 [4,] 94.1 94.50 96.40 93.85 91.35 [5,] 109.2 104.10 108.20 109.70 103.00 $n [1] 13 12 12 12 12 $conf [,1] [,2] [,3] [,4] [,5] [1,] 80.57177 79.42338 77.31203 83.38474 82.65296 [2,] 92.22823 94.97662 94.18797 97.61526 91.54704 $out [1] 66.5 $group [1] 5 $names [1] "1" "2" "3" "4" "5" Warning message: In bxp(list(stats = c(72.4, 80.8, 86.4, 94.1, 109.2, 68, 77.45, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5b4cu1225746312.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] [,10] [,11] [,12] [,13] [1,] 86.4 71.9 91.1 75.1 68.0 66.5 70.5 75.1 73.1 72.4 71.2 81.5 100.3 [2,] 88.6 80.6 91.1 86.4 82.1 76.1 80.7 84.2 80.8 78.8 73.6 81.5 100.3 [3,] 94.3 93.4 94.1 88.0 90.0 81.4 87.8 89.5 83.1 80.1 74.5 84.2 100.3 [4,] 98.3 104.1 94.9 103.0 94.3 82.5 94.1 92.0 90.0 87.3 86.4 85.3 100.3 [5,] 109.2 108.2 96.4 109.7 96.4 88.0 97.2 99.6 99.8 91.0 92.4 90.7 100.3 $n [1] 5 5 5 5 5 5 5 5 5 5 5 5 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 87.446 76.79496 91.41493 76.27048 81.37951 76.87778 78.3316 83.98854 [2,] 101.154 110.00504 96.78507 99.72952 98.62049 85.92222 97.2684 95.01146 [,9] [,10] [,11] [,12] [,13] [1,] 76.5993 74.09392 65.45555 81.51493 100.3 [2,] 89.6007 86.10608 83.54445 86.88507 100.3 $out [1] 84.4 69.9 $group [1] 3 12 $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" NA Warning message: In bxp(list(stats = c(86.4, 88.6, 94.3, 98.3, 109.2, 71.9, 80.6, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6wlwa1225746312.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,] 85.69167 85.75 86.2125 [2,] 86.41667 86.40 86.6875 [3,] 87.36154 87.10 86.7250 [4,] 87.44167 87.20 87.4500 [5,] 87.51667 87.20 87.8500 $n [1] 5 5 5 $conf [,1] [,2] [,3] [1,] 86.63728 86.53472 86.18622 [2,] 88.08580 87.66528 87.26378 $out [1] 90.5 $group [1] 2 $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(85.6916666666667, 86.4166666666667, 87.3615384615385, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1vwu91225746312.ps tmp/1vwu91225746312.png") > system("convert tmp/20nck1225746312.ps tmp/20nck1225746312.png") > system("convert tmp/3mie81225746312.ps tmp/3mie81225746312.png") > system("convert tmp/4r35o1225746312.ps tmp/4r35o1225746312.png") > system("convert tmp/5b4cu1225746312.ps tmp/5b4cu1225746312.png") > system("convert tmp/6wlwa1225746312.ps tmp/6wlwa1225746312.png") > > > proc.time() user system elapsed 1.284 0.823 1.700