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(115.9,112.9,126.3,116.8,112,129.7,113.6,115.7,119.5,125.8,129.6,128,112.8,101.6,123.9,118.8,109.1,130.6,112.4,111,116.2,119.8,117.2,127.3,107.7,97.5,120.1,110.6,111.3,119.8,105.5,108.7,128.7,119.5,121.1,128.4,108.8,107.5,125.6,102.9,107.5,120.4,104.3,100.6,121.9,112.7,124.9,123.9,102.2,104.9,109.8,98.9,107.3,112.6,104,110.6,100.8,103.8,117,108.4) > 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,] 115.9 NA [2,] 112.9 NA [3,] 126.3 NA [4,] 116.8 NA [5,] 112.0 NA [6,] 129.7 NA [7,] 113.6 NA [8,] 115.7 NA [9,] 119.5 NA [10,] 125.8 NA [11,] 129.6 NA [12,] 128.0 NA [13,] 112.8 NA [14,] 101.6 NA [15,] 123.9 NA [16,] 118.8 NA [17,] 109.1 NA [18,] 130.6 NA [19,] 112.4 NA [20,] 111.0 NA [21,] 116.2 NA [22,] 119.8 NA [23,] 117.2 NA [24,] 127.3 NA [25,] 107.7 NA [26,] 97.5 NA [27,] 120.1 NA [28,] 110.6 NA [29,] 111.3 NA [30,] 119.8 NA [31,] 105.5 NA [32,] 108.7 NA [33,] 128.7 NA [34,] 119.5 NA [35,] 121.1 NA [36,] 128.4 NA [37,] 108.8 NA [38,] 107.5 NA [39,] 125.6 NA [40,] 102.9 NA [41,] 107.5 NA [42,] 120.4 NA [43,] 104.3 NA [44,] 100.6 NA [45,] 121.9 NA [46,] 112.7 NA [47,] 124.9 NA [48,] 123.9 NA [49,] 102.2 NA [50,] 104.9 NA [51,] 109.8 NA [52,] 98.9 NA [53,] 107.3 NA [54,] 112.6 NA [55,] 104.0 NA [56,] 110.6 NA [57,] 100.8 NA [58,] 103.8 NA [59,] 117.0 NA [60,] 108.4 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/19qbb1193420593.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/2fbrd1193420593.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/3ubug1193420593.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/4v9xj1193420593.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,] 115.9 112.9 126.3 116.8 112 129.7 113.6 115.7 119.5 125.8 129.6 128 [2,] 115.9 112.9 126.3 116.8 112 129.7 113.6 115.7 119.5 125.8 129.6 128 [3,] 115.9 112.9 126.3 116.8 112 129.7 113.6 115.7 119.5 125.8 129.6 128 [4,] 115.9 112.9 126.3 116.8 112 129.7 113.6 115.7 119.5 125.8 129.6 128 [5,] 115.9 112.9 126.3 116.8 112 129.7 113.6 115.7 119.5 125.8 129.6 128 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 112.8 101.6 123.9 118.8 109.1 130.6 112.4 111 116.2 119.8 117.2 127.3 [2,] 112.8 101.6 123.9 118.8 109.1 130.6 112.4 111 116.2 119.8 117.2 127.3 [3,] 112.8 101.6 123.9 118.8 109.1 130.6 112.4 111 116.2 119.8 117.2 127.3 [4,] 112.8 101.6 123.9 118.8 109.1 130.6 112.4 111 116.2 119.8 117.2 127.3 [5,] 112.8 101.6 123.9 118.8 109.1 130.6 112.4 111 116.2 119.8 117.2 127.3 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [1,] 107.7 97.5 120.1 110.6 111.3 119.8 105.5 108.7 128.7 119.5 121.1 128.4 [2,] 107.7 97.5 120.1 110.6 111.3 119.8 105.5 108.7 128.7 119.5 121.1 128.4 [3,] 107.7 97.5 120.1 110.6 111.3 119.8 105.5 108.7 128.7 119.5 121.1 128.4 [4,] 107.7 97.5 120.1 110.6 111.3 119.8 105.5 108.7 128.7 119.5 121.1 128.4 [5,] 107.7 97.5 120.1 110.6 111.3 119.8 105.5 108.7 128.7 119.5 121.1 128.4 [,37] [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [1,] 108.8 107.5 125.6 102.9 107.5 120.4 104.3 100.6 121.9 112.7 124.9 123.9 [2,] 108.8 107.5 125.6 102.9 107.5 120.4 104.3 100.6 121.9 112.7 124.9 123.9 [3,] 108.8 107.5 125.6 102.9 107.5 120.4 104.3 100.6 121.9 112.7 124.9 123.9 [4,] 108.8 107.5 125.6 102.9 107.5 120.4 104.3 100.6 121.9 112.7 124.9 123.9 [5,] 108.8 107.5 125.6 102.9 107.5 120.4 104.3 100.6 121.9 112.7 124.9 123.9 [,49] [,50] [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [1,] 102.2 104.9 109.8 98.9 107.3 112.6 104 110.6 100.8 103.8 117 108.4 [2,] 102.2 104.9 109.8 98.9 107.3 112.6 104 110.6 100.8 103.8 117 108.4 [3,] 102.2 104.9 109.8 98.9 107.3 112.6 104 110.6 100.8 103.8 117 108.4 [4,] 102.2 104.9 109.8 98.9 107.3 112.6 104 110.6 100.8 103.8 117 108.4 [5,] 102.2 104.9 109.8 98.9 107.3 112.6 104 110.6 100.8 103.8 117 108.4 $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] [1,] 115.9 112.9 126.3 116.8 112 129.7 113.6 115.7 119.5 125.8 129.6 128 [2,] 115.9 112.9 126.3 116.8 112 129.7 113.6 115.7 119.5 125.8 129.6 128 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 112.8 101.6 123.9 118.8 109.1 130.6 112.4 111 116.2 119.8 117.2 127.3 [2,] 112.8 101.6 123.9 118.8 109.1 130.6 112.4 111 116.2 119.8 117.2 127.3 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [1,] 107.7 97.5 120.1 110.6 111.3 119.8 105.5 108.7 128.7 119.5 121.1 128.4 [2,] 107.7 97.5 120.1 110.6 111.3 119.8 105.5 108.7 128.7 119.5 121.1 128.4 [,37] [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48] [1,] 108.8 107.5 125.6 102.9 107.5 120.4 104.3 100.6 121.9 112.7 124.9 123.9 [2,] 108.8 107.5 125.6 102.9 107.5 120.4 104.3 100.6 121.9 112.7 124.9 123.9 [,49] [,50] [,51] [,52] [,53] [,54] [,55] [,56] [,57] [,58] [,59] [,60] [1,] 102.2 104.9 109.8 98.9 107.3 112.6 104 110.6 100.8 103.8 117 108.4 [2,] 102.2 104.9 109.8 98.9 107.3 112.6 104 110.6 100.8 103.8 117 108.4 $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/rcomp/tmp/5buyy1193420593.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,] 97.50 NA [2,] 107.60 NA [3,] 112.85 NA [4,] 120.75 NA [5,] 130.60 NA $n [1] 60 0 $conf [,1] [,2] [1,] 110.1677 NA [2,] 115.5323 NA $out numeric(0) $group numeric(0) $names [1] "1" NA > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6hwzo1193420593.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,] 97.50 97.50 97.50 [2,] 107.60 107.60 107.60 [3,] 112.85 112.85 112.85 [4,] 120.75 120.75 120.75 [5,] 130.60 130.60 130.60 $n [1] 60 60 60 $conf [,1] [,2] [,3] [1,] 110.1677 110.1677 110.1677 [2,] 115.5323 115.5323 115.5323 $out numeric(0) $group numeric(0) $names [1] "mean" "median" "midrange" > dev.off() null device 1 > > system("convert tmp/19qbb1193420593.ps tmp/19qbb1193420593.png") > system("convert tmp/2fbrd1193420593.ps tmp/2fbrd1193420593.png") > system("convert tmp/3ubug1193420593.ps tmp/3ubug1193420593.png") > system("convert tmp/4v9xj1193420593.ps tmp/4v9xj1193420593.png") > system("convert tmp/5buyy1193420593.ps tmp/5buyy1193420593.png") > system("convert tmp/6hwzo1193420593.ps tmp/6hwzo1193420593.png") > > > proc.time() user system elapsed 1.621 0.954 1.846