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(96.8,91.2,97.1,104.9,110.9,104.8,94.1,95.8,99.3,101.1,104.0,99.0,105.4,107.1,110.7,117.1,118.7,126.5,127.5,134.6,131.8,135.9,142.7,141.7,153.4,145.0,137.7,148.3,152.2,169.4,168.6,161.1,174.1,179.0,190.6,190.0,181.6,174.8,180.5,196.8,193.8,197.0,216.3,221.4,217.9,229.7,227.4,204.2,196.6,198.8,207.5,190.7,201.6,210.5,223.5,223.8,231.2,244.0,234.7,250.2) > par1 = '60' > #'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] 60 > (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 > arr [,1] [,2] [1,] 96.8 NA [2,] 91.2 NA [3,] 97.1 NA [4,] 104.9 NA [5,] 110.9 NA [6,] 104.8 NA [7,] 94.1 NA [8,] 95.8 NA [9,] 99.3 NA [10,] 101.1 NA [11,] 104.0 NA [12,] 99.0 NA [13,] 105.4 NA [14,] 107.1 NA [15,] 110.7 NA [16,] 117.1 NA [17,] 118.7 NA [18,] 126.5 NA [19,] 127.5 NA [20,] 134.6 NA [21,] 131.8 NA [22,] 135.9 NA [23,] 142.7 NA [24,] 141.7 NA [25,] 153.4 NA [26,] 145.0 NA [27,] 137.7 NA [28,] 148.3 NA [29,] 152.2 NA [30,] 169.4 NA [31,] 168.6 NA [32,] 161.1 NA [33,] 174.1 NA [34,] 179.0 NA [35,] 190.6 NA [36,] 190.0 NA [37,] 181.6 NA [38,] 174.8 NA [39,] 180.5 NA [40,] 196.8 NA [41,] 193.8 NA [42,] 197.0 NA [43,] 216.3 NA [44,] 221.4 NA [45,] 217.9 NA [46,] 229.7 NA [47,] 227.4 NA [48,] 204.2 NA [49,] 196.6 NA [50,] 198.8 NA [51,] 207.5 NA [52,] 190.7 NA [53,] 201.6 NA [54,] 210.5 NA [55,] 223.5 NA [56,] 223.8 NA [57,] 231.2 NA [58,] 244.0 NA [59,] 234.7 NA [60,] 250.2 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/1mpci1225098697.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/29j1w1225098697.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/3eajx1225098698.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/4ayzi1225098698.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,] 96.8 91.2 97.1 104.9 110.9 104.8 94.1 95.8 99.3 101.1 104 99 105.4 [2,] 96.8 91.2 97.1 104.9 110.9 104.8 94.1 95.8 99.3 101.1 104 99 105.4 [3,] 96.8 91.2 97.1 104.9 110.9 104.8 94.1 95.8 99.3 101.1 104 99 105.4 [4,] 96.8 91.2 97.1 104.9 110.9 104.8 94.1 95.8 99.3 101.1 104 99 105.4 [5,] 96.8 91.2 97.1 104.9 110.9 104.8 94.1 95.8 99.3 101.1 104 99 105.4 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 107.1 110.7 117.1 118.7 126.5 127.5 134.6 131.8 135.9 142.7 141.7 153.4 [2,] 107.1 110.7 117.1 118.7 126.5 127.5 134.6 131.8 135.9 142.7 141.7 153.4 [3,] 107.1 110.7 117.1 118.7 126.5 127.5 134.6 131.8 135.9 142.7 141.7 153.4 [4,] 107.1 110.7 117.1 118.7 126.5 127.5 134.6 131.8 135.9 142.7 141.7 153.4 [5,] 107.1 110.7 117.1 118.7 126.5 127.5 134.6 131.8 135.9 142.7 141.7 153.4 [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [1,] 145 137.7 148.3 152.2 169.4 168.6 161.1 174.1 179 190.6 190 181.6 [2,] 145 137.7 148.3 152.2 169.4 168.6 161.1 174.1 179 190.6 190 181.6 [3,] 145 137.7 148.3 152.2 169.4 168.6 161.1 174.1 179 190.6 190 181.6 [4,] 145 137.7 148.3 152.2 169.4 168.6 161.1 174.1 179 190.6 190 181.6 [5,] 145 137.7 148.3 152.2 169.4 168.6 161.1 174.1 179 190.6 190 181.6 [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [1,] 174.8 180.5 196.8 193.8 197 216.3 221.4 217.9 229.7 227.4 204.2 196.6 [2,] 174.8 180.5 196.8 193.8 197 216.3 221.4 217.9 229.7 227.4 204.2 196.6 [3,] 174.8 180.5 196.8 193.8 197 216.3 221.4 217.9 229.7 227.4 204.2 196.6 [4,] 174.8 180.5 196.8 193.8 197 216.3 221.4 217.9 229.7 227.4 204.2 196.6 [5,] 174.8 180.5 196.8 193.8 197 216.3 221.4 217.9 229.7 227.4 204.2 196.6 [,50] [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [1,] 198.8 207.5 190.7 201.6 210.5 223.5 223.8 231.2 244 234.7 250.2 [2,] 198.8 207.5 190.7 201.6 210.5 223.5 223.8 231.2 244 234.7 250.2 [3,] 198.8 207.5 190.7 201.6 210.5 223.5 223.8 231.2 244 234.7 250.2 [4,] 198.8 207.5 190.7 201.6 210.5 223.5 223.8 231.2 244 234.7 250.2 [5,] 198.8 207.5 190.7 201.6 210.5 223.5 223.8 231.2 244 234.7 250.2 $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 $conf [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 96.8 91.2 97.1 104.9 110.9 104.8 94.1 95.8 99.3 101.1 104 99 105.4 [2,] 96.8 91.2 97.1 104.9 110.9 104.8 94.1 95.8 99.3 101.1 104 99 105.4 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 107.1 110.7 117.1 118.7 126.5 127.5 134.6 131.8 135.9 142.7 141.7 153.4 [2,] 107.1 110.7 117.1 118.7 126.5 127.5 134.6 131.8 135.9 142.7 141.7 153.4 [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [1,] 145 137.7 148.3 152.2 169.4 168.6 161.1 174.1 179 190.6 190 181.6 [2,] 145 137.7 148.3 152.2 169.4 168.6 161.1 174.1 179 190.6 190 181.6 [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [1,] 174.8 180.5 196.8 193.8 197 216.3 221.4 217.9 229.7 227.4 204.2 196.6 [2,] 174.8 180.5 196.8 193.8 197 216.3 221.4 217.9 229.7 227.4 204.2 196.6 [,50] [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [1,] 198.8 207.5 190.7 201.6 210.5 223.5 223.8 231.2 244 234.7 250.2 [2,] 198.8 207.5 190.7 201.6 210.5 223.5 223.8 231.2 244 234.7 250.2 $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" > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/5wx1b1225098698.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,] 91.20 NA [2,] 114.00 NA [3,] 164.85 NA [4,] 200.20 NA [5,] 250.20 NA $n [1] 60 0 $conf [,1] [,2] [1,] 147.2672 NA [2,] 182.4328 NA $out numeric(0) $group numeric(0) $names [1] "1" NA > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/6qsmx1225098698.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,] 91.20 91.20 91.20 [2,] 114.00 114.00 114.00 [3,] 164.85 164.85 164.85 [4,] 200.20 200.20 200.20 [5,] 250.20 250.20 250.20 $n [1] 60 60 60 $conf [,1] [,2] [,3] [1,] 147.2672 147.2672 147.2672 [2,] 182.4328 182.4328 182.4328 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > system("convert tmp/1mpci1225098697.ps tmp/1mpci1225098697.png") > system("convert tmp/29j1w1225098697.ps tmp/29j1w1225098697.png") > system("convert tmp/3eajx1225098698.ps tmp/3eajx1225098698.png") > system("convert tmp/4ayzi1225098698.ps tmp/4ayzi1225098698.png") > system("convert tmp/5wx1b1225098698.ps tmp/5wx1b1225098698.png") > system("convert tmp/6qsmx1225098698.ps tmp/6qsmx1225098698.png") > > > proc.time() user system elapsed 2.029 1.256 2.223