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.9,98.0,97.9,100.9,103.9,103.1,102.5,104.3,102.6,101.7,102.8,105.4,110.9,113.5,116.3,124.0,128.8,133.5,132.6,128.4,127.3,126.7,123.3,123.2,124.4,128.2,128.7,135.7,139.0,145.4,142.4,137.7,137.0,137.1,139.3,139.6,140.4,142.3,148.3,157.7,161.6,161.7,171.8,185.1,176.7,184.4,183.0,180.9,187.0,189.9,193.8,194.5,198.7,204.7,213.2,214.7,211.0,213.2,206.3,210.8) > 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.9 NA [2,] 98.0 NA [3,] 97.9 NA [4,] 100.9 NA [5,] 103.9 NA [6,] 103.1 NA [7,] 102.5 NA [8,] 104.3 NA [9,] 102.6 NA [10,] 101.7 NA [11,] 102.8 NA [12,] 105.4 NA [13,] 110.9 NA [14,] 113.5 NA [15,] 116.3 NA [16,] 124.0 NA [17,] 128.8 NA [18,] 133.5 NA [19,] 132.6 NA [20,] 128.4 NA [21,] 127.3 NA [22,] 126.7 NA [23,] 123.3 NA [24,] 123.2 NA [25,] 124.4 NA [26,] 128.2 NA [27,] 128.7 NA [28,] 135.7 NA [29,] 139.0 NA [30,] 145.4 NA [31,] 142.4 NA [32,] 137.7 NA [33,] 137.0 NA [34,] 137.1 NA [35,] 139.3 NA [36,] 139.6 NA [37,] 140.4 NA [38,] 142.3 NA [39,] 148.3 NA [40,] 157.7 NA [41,] 161.6 NA [42,] 161.7 NA [43,] 171.8 NA [44,] 185.1 NA [45,] 176.7 NA [46,] 184.4 NA [47,] 183.0 NA [48,] 180.9 NA [49,] 187.0 NA [50,] 189.9 NA [51,] 193.8 NA [52,] 194.5 NA [53,] 198.7 NA [54,] 204.7 NA [55,] 213.2 NA [56,] 214.7 NA [57,] 211.0 NA [58,] 213.2 NA [59,] 206.3 NA [60,] 210.8 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/1xkes1225098853.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/2k34n1225098853.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/3dbsq1225098853.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/4n0gu1225098853.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.9 98 97.9 100.9 103.9 103.1 102.5 104.3 102.6 101.7 102.8 105.4 110.9 [2,] 96.9 98 97.9 100.9 103.9 103.1 102.5 104.3 102.6 101.7 102.8 105.4 110.9 [3,] 96.9 98 97.9 100.9 103.9 103.1 102.5 104.3 102.6 101.7 102.8 105.4 110.9 [4,] 96.9 98 97.9 100.9 103.9 103.1 102.5 104.3 102.6 101.7 102.8 105.4 110.9 [5,] 96.9 98 97.9 100.9 103.9 103.1 102.5 104.3 102.6 101.7 102.8 105.4 110.9 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 113.5 116.3 124 128.8 133.5 132.6 128.4 127.3 126.7 123.3 123.2 124.4 [2,] 113.5 116.3 124 128.8 133.5 132.6 128.4 127.3 126.7 123.3 123.2 124.4 [3,] 113.5 116.3 124 128.8 133.5 132.6 128.4 127.3 126.7 123.3 123.2 124.4 [4,] 113.5 116.3 124 128.8 133.5 132.6 128.4 127.3 126.7 123.3 123.2 124.4 [5,] 113.5 116.3 124 128.8 133.5 132.6 128.4 127.3 126.7 123.3 123.2 124.4 [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [1,] 128.2 128.7 135.7 139 145.4 142.4 137.7 137 137.1 139.3 139.6 140.4 [2,] 128.2 128.7 135.7 139 145.4 142.4 137.7 137 137.1 139.3 139.6 140.4 [3,] 128.2 128.7 135.7 139 145.4 142.4 137.7 137 137.1 139.3 139.6 140.4 [4,] 128.2 128.7 135.7 139 145.4 142.4 137.7 137 137.1 139.3 139.6 140.4 [5,] 128.2 128.7 135.7 139 145.4 142.4 137.7 137 137.1 139.3 139.6 140.4 [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [1,] 142.3 148.3 157.7 161.6 161.7 171.8 185.1 176.7 184.4 183 180.9 187 [2,] 142.3 148.3 157.7 161.6 161.7 171.8 185.1 176.7 184.4 183 180.9 187 [3,] 142.3 148.3 157.7 161.6 161.7 171.8 185.1 176.7 184.4 183 180.9 187 [4,] 142.3 148.3 157.7 161.6 161.7 171.8 185.1 176.7 184.4 183 180.9 187 [5,] 142.3 148.3 157.7 161.6 161.7 171.8 185.1 176.7 184.4 183 180.9 187 [,50] [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [1,] 189.9 193.8 194.5 198.7 204.7 213.2 214.7 211 213.2 206.3 210.8 [2,] 189.9 193.8 194.5 198.7 204.7 213.2 214.7 211 213.2 206.3 210.8 [3,] 189.9 193.8 194.5 198.7 204.7 213.2 214.7 211 213.2 206.3 210.8 [4,] 189.9 193.8 194.5 198.7 204.7 213.2 214.7 211 213.2 206.3 210.8 [5,] 189.9 193.8 194.5 198.7 204.7 213.2 214.7 211 213.2 206.3 210.8 $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.9 98 97.9 100.9 103.9 103.1 102.5 104.3 102.6 101.7 102.8 105.4 110.9 [2,] 96.9 98 97.9 100.9 103.9 103.1 102.5 104.3 102.6 101.7 102.8 105.4 110.9 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 113.5 116.3 124 128.8 133.5 132.6 128.4 127.3 126.7 123.3 123.2 124.4 [2,] 113.5 116.3 124 128.8 133.5 132.6 128.4 127.3 126.7 123.3 123.2 124.4 [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [1,] 128.2 128.7 135.7 139 145.4 142.4 137.7 137 137.1 139.3 139.6 140.4 [2,] 128.2 128.7 135.7 139 145.4 142.4 137.7 137 137.1 139.3 139.6 140.4 [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [,49] [1,] 142.3 148.3 157.7 161.6 161.7 171.8 185.1 176.7 184.4 183 180.9 187 [2,] 142.3 148.3 157.7 161.6 161.7 171.8 185.1 176.7 184.4 183 180.9 187 [,50] [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [1,] 189.9 193.8 194.5 198.7 204.7 213.2 214.7 211 213.2 206.3 210.8 [2,] 189.9 193.8 194.5 198.7 204.7 213.2 214.7 211 213.2 206.3 210.8 $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/54vop1225098853.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,] 96.90 NA [2,] 119.75 NA [3,] 137.40 NA [4,] 181.95 NA [5,] 214.70 NA $n [1] 60 0 $conf [,1] [,2] [1,] 124.7126 NA [2,] 150.0874 NA $out numeric(0) $group numeric(0) $names [1] "1" NA > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/6cj7y1225098853.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,] 96.90 96.90 96.90 [2,] 119.75 119.75 119.75 [3,] 137.40 137.40 137.40 [4,] 181.95 181.95 181.95 [5,] 214.70 214.70 214.70 $n [1] 60 60 60 $conf [,1] [,2] [,3] [1,] 124.7126 124.7126 124.7126 [2,] 150.0874 150.0874 150.0874 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > system("convert tmp/1xkes1225098853.ps tmp/1xkes1225098853.png") > system("convert tmp/2k34n1225098853.ps tmp/2k34n1225098853.png") > system("convert tmp/3dbsq1225098853.ps tmp/3dbsq1225098853.png") > system("convert tmp/4n0gu1225098853.ps tmp/4n0gu1225098853.png") > system("convert tmp/54vop1225098853.ps tmp/54vop1225098853.png") > system("convert tmp/6cj7y1225098853.ps tmp/6cj7y1225098853.png") > > > proc.time() user system elapsed 2.049 1.240 2.801