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) > 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] 61 > (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 4 4 4 4 4 4 4 4 4 4 4 4 4 4 > arr [,1] [,2] [,3] [,4] [,5] [1,] 109.2 86.4 97.2 72.4 100.3 [2,] 88.6 88.0 94.1 78.8 NA [3,] 94.3 75.1 80.7 87.3 NA [4,] 98.3 109.7 70.5 91.0 NA [5,] 86.4 103.0 87.8 80.1 NA [6,] 80.6 82.1 89.5 73.6 NA [7,] 104.1 68.0 99.6 86.4 NA [8,] 108.2 96.4 84.2 74.5 NA [9,] 93.4 94.3 75.1 71.2 NA [10,] 71.9 90.0 92.0 92.4 NA [11,] 94.1 88.0 80.8 81.5 NA [12,] 94.9 76.1 73.1 85.3 NA [13,] 96.4 82.5 99.8 69.9 NA [14,] 91.1 81.4 90.0 84.2 NA [15,] 84.4 66.5 83.1 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/freestat/rcomp/tmp/1giwq1225396445.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/freestat/rcomp/tmp/2l8mn1225396445.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/freestat/rcomp/tmp/3ohmc1225396445.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/freestat/rcomp/tmp/4r1wc1225396445.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,] 72.4 78.80 75.1 70.50 80.10 73.60 68.00 74.50 71.20 71.90 80.80 73.1 [2,] 86.4 83.40 77.9 80.75 83.25 77.10 77.20 79.35 73.15 80.95 81.15 74.6 [3,] 97.2 88.30 84.0 94.65 87.10 81.35 93.00 90.30 84.25 91.00 84.75 80.7 [4,] 100.3 91.35 90.8 104.00 95.40 85.80 101.85 102.30 93.85 92.20 91.05 90.1 [5,] 109.2 94.10 94.3 109.70 103.00 89.50 104.10 108.20 94.30 92.40 94.10 94.9 [,13] [,14] [,15] [1,] 69.90 81.40 66.50 [2,] 76.20 82.80 74.80 [3,] 89.45 87.10 83.75 [4,] 98.10 90.55 87.55 [5,] 99.80 91.10 90.70 $n [1] 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 87.3783 82.0195 73.809 76.2825 77.5015 74.477 73.5265 72.1695 67.897 [2,] 107.0217 94.5805 94.191 113.0175 96.6985 88.223 112.4735 108.4305 100.603 [,10] [,11] [,12] [,13] [,14] [,15] [1,] 82.1125 76.929 68.455 72.149 80.9775 73.6775 [2,] 99.8875 92.571 92.945 106.751 93.2225 93.8225 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" Warning message: In bxp(list(stats = c(72.4, 86.4, 97.2, 100.3, 109.2, 78.8, 83.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/56roe1225396445.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,] 80.60 66.50 70.50 69.90 100.3 [2,] 87.50 78.75 80.75 74.05 100.3 [3,] 94.10 86.40 87.80 81.50 100.3 [4,] 97.35 92.15 93.05 86.85 100.3 [5,] 109.20 109.70 99.80 92.40 100.3 $n [1] 15 15 15 15 1 $conf [,1] [,2] [,3] [,4] [,5] [1,] 90.08165 80.93341 82.78216 76.27819 100.3 [2,] 98.11835 91.86659 92.81784 86.72181 100.3 $out [1] 71.9 $group [1] 1 $names [1] "1" "2" "3" "4" NA Warning message: In bxp(list(stats = c(80.6, 87.5, 94.1, 97.35, 109.2, 66.5, 78.75, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/6vqq31225396445.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.175 80.700 81.4000 [2,] 83.925 84.125 84.0250 [3,] 86.675 87.100 87.8375 [4,] 89.425 90.650 89.6750 [5,] 93.100 97.200 93.5125 $n [1] 15 15 15 $conf [,1] [,2] [,3] [1,] 84.43125 84.4381 85.53256 [2,] 88.91875 89.7619 90.14244 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" Warning message: In bxp(list(stats = c(81.175, 83.925, 86.675, 89.425, 93.1, 80.7, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > > system("convert tmp/1giwq1225396445.ps tmp/1giwq1225396445.png") > system("convert tmp/2l8mn1225396445.ps tmp/2l8mn1225396445.png") > system("convert tmp/3ohmc1225396445.ps tmp/3ohmc1225396445.png") > system("convert tmp/4r1wc1225396445.ps tmp/4r1wc1225396445.png") > system("convert tmp/56roe1225396445.ps tmp/56roe1225396445.png") > system("convert tmp/6vqq31225396445.ps tmp/6vqq31225396445.png") > > > proc.time() user system elapsed 1.953 1.261 2.139