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 = '50' > #'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] 1 > 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] 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 1 1 > arr [,1] [,2] [1,] 109.2 73.6 [2,] 88.6 86.4 [3,] 94.3 74.5 [4,] 98.3 71.2 [5,] 86.4 92.4 [6,] 80.6 81.5 [7,] 104.1 85.3 [8,] 108.2 69.9 [9,] 93.4 84.2 [10,] 71.9 90.7 [11,] 94.1 100.3 [12,] 94.9 NA [13,] 96.4 NA [14,] 91.1 NA [15,] 84.4 NA [16,] 86.4 NA [17,] 88.0 NA [18,] 75.1 NA [19,] 109.7 NA [20,] 103.0 NA [21,] 82.1 NA [22,] 68.0 NA [23,] 96.4 NA [24,] 94.3 NA [25,] 90.0 NA [26,] 88.0 NA [27,] 76.1 NA [28,] 82.5 NA [29,] 81.4 NA [30,] 66.5 NA [31,] 97.2 NA [32,] 94.1 NA [33,] 80.7 NA [34,] 70.5 NA [35,] 87.8 NA [36,] 89.5 NA [37,] 99.6 NA [38,] 84.2 NA [39,] 75.1 NA [40,] 92.0 NA [41,] 80.8 NA [42,] 73.1 NA [43,] 99.8 NA [44,] 90.0 NA [45,] 83.1 NA [46,] 72.4 NA [47,] 78.8 NA [48,] 87.3 NA [49,] 91.0 NA [50,] 80.1 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/1gven1225402486.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/27ov01225402486.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/3bjx51225402486.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/4ct381225402486.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] [,13] [1,] 73.6 86.4 74.5 71.20 86.4 80.60 85.3 69.90 84.2 71.9 94.1 94.9 96.4 [2,] 73.6 86.4 74.5 71.20 86.4 80.60 85.3 69.90 84.2 71.9 94.1 94.9 96.4 [3,] 91.4 87.5 84.4 84.75 89.4 81.05 94.7 89.05 88.8 81.3 97.2 94.9 96.4 [4,] 109.2 88.6 94.3 98.30 92.4 81.50 104.1 108.20 93.4 90.7 100.3 94.9 96.4 [5,] 109.2 88.6 94.3 98.30 92.4 81.50 104.1 108.20 93.4 90.7 100.3 94.9 96.4 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 91.1 84.4 86.4 88 75.1 109.7 103 82.1 68 96.4 94.3 90 [2,] 91.1 84.4 86.4 88 75.1 109.7 103 82.1 68 96.4 94.3 90 [3,] 91.1 84.4 86.4 88 75.1 109.7 103 82.1 68 96.4 94.3 90 [4,] 91.1 84.4 86.4 88 75.1 109.7 103 82.1 68 96.4 94.3 90 [5,] 91.1 84.4 86.4 88 75.1 109.7 103 82.1 68 96.4 94.3 90 [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [1,] 88 76.1 82.5 81.4 66.5 97.2 94.1 80.7 70.5 87.8 89.5 99.6 [2,] 88 76.1 82.5 81.4 66.5 97.2 94.1 80.7 70.5 87.8 89.5 99.6 [3,] 88 76.1 82.5 81.4 66.5 97.2 94.1 80.7 70.5 87.8 89.5 99.6 [4,] 88 76.1 82.5 81.4 66.5 97.2 94.1 80.7 70.5 87.8 89.5 99.6 [5,] 88 76.1 82.5 81.4 66.5 97.2 94.1 80.7 70.5 87.8 89.5 99.6 [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [1,] 84.2 75.1 92 80.8 73.1 99.8 90 83.1 72.4 78.8 87.3 91 [2,] 84.2 75.1 92 80.8 73.1 99.8 90 83.1 72.4 78.8 87.3 91 [3,] 84.2 75.1 92 80.8 73.1 99.8 90 83.1 72.4 78.8 87.3 91 [4,] 84.2 75.1 92 80.8 73.1 99.8 90 83.1 72.4 78.8 87.3 91 [5,] 84.2 75.1 92 80.8 73.1 99.8 90 83.1 72.4 78.8 87.3 91 [,50] [1,] 80.1 [2,] 80.1 [3,] 80.1 [4,] 80.1 [5,] 80.1 $n [1] 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [39] 1 1 1 1 1 1 1 1 1 1 1 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 51.62666 85.0421 62.27887 54.4731 82.69663 80.0445 73.6961 46.26014 [2,] 131.17334 89.9579 106.52113 115.0269 96.10337 82.0555 115.7039 131.83986 [,9] [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [1,] 78.5215 60.2961 90.27318 94.9 96.4 91.1 84.4 86.4 88 75.1 109.7 [2,] 99.0785 102.3039 104.12682 94.9 96.4 91.1 84.4 86.4 88 75.1 109.7 [,20] [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [,31] [1,] 103 82.1 68 96.4 94.3 90 88 76.1 82.5 81.4 66.5 97.2 [2,] 103 82.1 68 96.4 94.3 90 88 76.1 82.5 81.4 66.5 97.2 [,32] [,33] [,34] [,35] [,36] [,37] [,38] [,39] [,40] [,41] [,42] [,43] [1,] 94.1 80.7 70.5 87.8 89.5 99.6 84.2 75.1 92 80.8 73.1 99.8 [2,] 94.1 80.7 70.5 87.8 89.5 99.6 84.2 75.1 92 80.8 73.1 99.8 [,44] [,45] [,46] [,47] [,48] [,49] [,50] [1,] 90 83.1 72.4 78.8 87.3 91 80.1 [2,] 90 83.1 72.4 78.8 87.3 91 80.1 $out numeric(0) $group numeric(0) $names [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" [16] "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28" "29" "30" [31] "31" "32" "33" "34" "35" "36" "37" "38" "39" "40" "41" "42" "43" "44" "45" [46] "46" "47" "48" "49" "50" Warning message: In bxp(list(stats = c(73.6, 73.6, 91.4, 109.2, 109.2, 86.4, 86.4, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/5zm451225402486.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] [1,] 66.5 69.90 [2,] 80.7 74.05 [3,] 88.0 84.20 [4,] 94.3 88.55 [5,] 109.7 100.30 $n [1] 50 11 $conf [,1] [,2] [1,] 84.96114 77.29238 [2,] 91.03886 91.10762 $out numeric(0) $group numeric(0) $names [1] "1" NA Warning message: In bxp(list(stats = c(66.5, 80.7, 88, 94.3, 109.7, 69.9, 74.05, : some notches went outside hinges ('box'): maybe set notch=FALSE > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/6l4v81225402486.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,] 66.50 66.50 66.50 [2,] 81.05 81.05 81.05 [3,] 87.65 87.65 87.65 [4,] 92.00 92.00 92.00 [5,] 103.00 103.00 103.00 $n [1] 50 50 50 $conf [,1] [,2] [,3] [1,] 85.20327 85.20327 85.20327 [2,] 90.09673 90.09673 90.09673 $out [1] 109.7 109.7 109.7 $group [1] 1 2 3 $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > system("convert tmp/1gven1225402486.ps tmp/1gven1225402486.png") > system("convert tmp/27ov01225402486.ps tmp/27ov01225402486.png") > system("convert tmp/3bjx51225402486.ps tmp/3bjx51225402486.png") > system("convert tmp/4ct381225402486.ps tmp/4ct381225402486.png") > system("convert tmp/5zm451225402486.ps tmp/5zm451225402486.png") > system("convert tmp/6l4v81225402486.ps tmp/6l4v81225402486.png") > > > proc.time() user system elapsed 2.020 1.258 2.232