R version 2.5.1 (2007-06-27) Copyright (C) 2007 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(16.8,18.7,18.7,18.7,16.8,16.8,16.8,16.0,16.0,16.0,18.0,18.0,18.0,18.0,18.0,18.0,21.6,21.6,21.6,20.1,20.1,20.1,22.9,22.9,22.9,24.0,24.0,24.0,20.3,20.3,20.3,15.8,15.8,15.8,23.2,23.2,23.2,20.9,20.9,20.9,19.8,19.8,19.8,20.6,20.6,20.6,21.1,21.1,21.1,22.4,22.4,22.4,20.5,20.5,20.5,18.4,18.4,18.4,17.6,17.6,17.6,18.5,18.5,18.5,17.3,17.3,17.3,16.2,16.2,16.2,18.0,18.0,18.0) > par1 = '73' > #'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] 73 > (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] 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 1 1 1 1 1 1 1 1 1 1 1 [39] 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 1 1 1 1 1 1 1 1 > arr [,1] [,2] [1,] 16.8 NA [2,] 18.7 NA [3,] 18.7 NA [4,] 18.7 NA [5,] 16.8 NA [6,] 16.8 NA [7,] 16.8 NA [8,] 16.0 NA [9,] 16.0 NA [10,] 16.0 NA [11,] 18.0 NA [12,] 18.0 NA [13,] 18.0 NA [14,] 18.0 NA [15,] 18.0 NA [16,] 18.0 NA [17,] 21.6 NA [18,] 21.6 NA [19,] 21.6 NA [20,] 20.1 NA [21,] 20.1 NA [22,] 20.1 NA [23,] 22.9 NA [24,] 22.9 NA [25,] 22.9 NA [26,] 24.0 NA [27,] 24.0 NA [28,] 24.0 NA [29,] 20.3 NA [30,] 20.3 NA [31,] 20.3 NA [32,] 15.8 NA [33,] 15.8 NA [34,] 15.8 NA [35,] 23.2 NA [36,] 23.2 NA [37,] 23.2 NA [38,] 20.9 NA [39,] 20.9 NA [40,] 20.9 NA [41,] 19.8 NA [42,] 19.8 NA [43,] 19.8 NA [44,] 20.6 NA [45,] 20.6 NA [46,] 20.6 NA [47,] 21.1 NA [48,] 21.1 NA [49,] 21.1 NA [50,] 22.4 NA [51,] 22.4 NA [52,] 22.4 NA [53,] 20.5 NA [54,] 20.5 NA [55,] 20.5 NA [56,] 18.4 NA [57,] 18.4 NA [58,] 18.4 NA [59,] 17.6 NA [60,] 17.6 NA [61,] 17.6 NA [62,] 18.5 NA [63,] 18.5 NA [64,] 18.5 NA [65,] 17.3 NA [66,] 17.3 NA [67,] 17.3 NA [68,] 16.2 NA [69,] 16.2 NA [70,] 16.2 NA [71,] 18.0 NA [72,] 18.0 NA [73,] 18.0 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/1nme61193309108.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/24ujb1193309108.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/31g811193309108.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/4328b1193309108.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] [,14] [1,] 16.8 18.7 18.7 18.7 16.8 16.8 16.8 16 16 16 18 18 18 18 [2,] 16.8 18.7 18.7 18.7 16.8 16.8 16.8 16 16 16 18 18 18 18 [3,] 16.8 18.7 18.7 18.7 16.8 16.8 16.8 16 16 16 18 18 18 18 [4,] 16.8 18.7 18.7 18.7 16.8 16.8 16.8 16 16 16 18 18 18 18 [5,] 16.8 18.7 18.7 18.7 16.8 16.8 16.8 16 16 16 18 18 18 18 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 18 18 21.6 21.6 21.6 20.1 20.1 20.1 22.9 22.9 22.9 24 [2,] 18 18 21.6 21.6 21.6 20.1 20.1 20.1 22.9 22.9 22.9 24 [3,] 18 18 21.6 21.6 21.6 20.1 20.1 20.1 22.9 22.9 22.9 24 [4,] 18 18 21.6 21.6 21.6 20.1 20.1 20.1 22.9 22.9 22.9 24 [5,] 18 18 21.6 21.6 21.6 20.1 20.1 20.1 22.9 22.9 22.9 24 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 24 24 20.3 20.3 20.3 15.8 15.8 15.8 23.2 23.2 23.2 20.9 [2,] 24 24 20.3 20.3 20.3 15.8 15.8 15.8 23.2 23.2 23.2 20.9 [3,] 24 24 20.3 20.3 20.3 15.8 15.8 15.8 23.2 23.2 23.2 20.9 [4,] 24 24 20.3 20.3 20.3 15.8 15.8 15.8 23.2 23.2 23.2 20.9 [5,] 24 24 20.3 20.3 20.3 15.8 15.8 15.8 23.2 23.2 23.2 20.9 [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50] [1,] 20.9 20.9 19.8 19.8 19.8 20.6 20.6 20.6 21.1 21.1 21.1 22.4 [2,] 20.9 20.9 19.8 19.8 19.8 20.6 20.6 20.6 21.1 21.1 21.1 22.4 [3,] 20.9 20.9 19.8 19.8 19.8 20.6 20.6 20.6 21.1 21.1 21.1 22.4 [4,] 20.9 20.9 19.8 19.8 19.8 20.6 20.6 20.6 21.1 21.1 21.1 22.4 [5,] 20.9 20.9 19.8 19.8 19.8 20.6 20.6 20.6 21.1 21.1 21.1 22.4 [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [,61] [,62] [1,] 22.4 22.4 20.5 20.5 20.5 18.4 18.4 18.4 17.6 17.6 17.6 18.5 [2,] 22.4 22.4 20.5 20.5 20.5 18.4 18.4 18.4 17.6 17.6 17.6 18.5 [3,] 22.4 22.4 20.5 20.5 20.5 18.4 18.4 18.4 17.6 17.6 17.6 18.5 [4,] 22.4 22.4 20.5 20.5 20.5 18.4 18.4 18.4 17.6 17.6 17.6 18.5 [5,] 22.4 22.4 20.5 20.5 20.5 18.4 18.4 18.4 17.6 17.6 17.6 18.5 [,63] [,64] [,65] [,66] [,67] [,68] [,69] [,70] [,71] [,72] [,73] [1,] 18.5 18.5 17.3 17.3 17.3 16.2 16.2 16.2 18 18 18 [2,] 18.5 18.5 17.3 17.3 17.3 16.2 16.2 16.2 18 18 18 [3,] 18.5 18.5 17.3 17.3 17.3 16.2 16.2 16.2 18 18 18 [4,] 18.5 18.5 17.3 17.3 17.3 16.2 16.2 16.2 18 18 18 [5,] 18.5 18.5 17.3 17.3 17.3 16.2 16.2 16.2 18 18 18 $n [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 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 16.8 18.7 18.7 18.7 16.8 16.8 16.8 16 16 16 18 18 18 18 [2,] 16.8 18.7 18.7 18.7 16.8 16.8 16.8 16 16 16 18 18 18 18 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 18 18 21.6 21.6 21.6 20.1 20.1 20.1 22.9 22.9 22.9 24 [2,] 18 18 21.6 21.6 21.6 20.1 20.1 20.1 22.9 22.9 22.9 24 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 24 24 20.3 20.3 20.3 15.8 15.8 15.8 23.2 23.2 23.2 20.9 [2,] 24 24 20.3 20.3 20.3 15.8 15.8 15.8 23.2 23.2 23.2 20.9 [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [,50] [1,] 20.9 20.9 19.8 19.8 19.8 20.6 20.6 20.6 21.1 21.1 21.1 22.4 [2,] 20.9 20.9 19.8 19.8 19.8 20.6 20.6 20.6 21.1 21.1 21.1 22.4 [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [,61] [,62] [1,] 22.4 22.4 20.5 20.5 20.5 18.4 18.4 18.4 17.6 17.6 17.6 18.5 [2,] 22.4 22.4 20.5 20.5 20.5 18.4 18.4 18.4 17.6 17.6 17.6 18.5 [,63] [,64] [,65] [,66] [,67] [,68] [,69] [,70] [,71] [,72] [,73] [1,] 18.5 18.5 17.3 17.3 17.3 16.2 16.2 16.2 18 18 18 [2,] 18.5 18.5 17.3 17.3 17.3 16.2 16.2 16.2 18 18 18 $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" "51" "52" "53" "54" "55" "56" "57" "58" "59" "60" [61] "61" "62" "63" "64" "65" "66" "67" "68" "69" "70" "71" "72" "73" > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5zww91193309108.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,] 15.8 NA [2,] 17.6 NA [3,] 18.7 NA [4,] 20.9 NA [5,] 24.0 NA $n [1] 73 0 $conf [,1] [,2] [1,] 18.08975 NA [2,] 19.31025 NA $out numeric(0) $group numeric(0) $names [1] "1" NA > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6pdnj1193309108.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,] 15.8 15.8 15.8 [2,] 17.6 17.6 17.6 [3,] 18.7 18.7 18.7 [4,] 20.9 20.9 20.9 [5,] 24.0 24.0 24.0 $n [1] 73 73 73 $conf [,1] [,2] [,3] [1,] 18.08975 18.08975 18.08975 [2,] 19.31025 19.31025 19.31025 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > system("convert tmp/1nme61193309108.ps tmp/1nme61193309108.png") > system("convert tmp/24ujb1193309108.ps tmp/24ujb1193309108.png") > system("convert tmp/31g811193309108.ps tmp/31g811193309108.png") > system("convert tmp/4328b1193309108.ps tmp/4328b1193309108.png") > system("convert tmp/5zww91193309108.ps tmp/5zww91193309108.png") > system("convert tmp/6pdnj1193309108.ps tmp/6pdnj1193309108.png") > > > proc.time() user system elapsed 1.756 0.995 2.226