R version 2.8.0 (2008-10-20) 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. Natural language support but running in an English locale 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.1,96.5,96.9,97.8,98.9,100.2,101.2,101,101.6,102.4,103.7,103.7,104.6,104.5,104.5,105.6,106.1,107.6,107.7,108.3,108.1,108.1,108,108.2,108.9,109.8,109.9,109.8,110.9,111.1,112.2,112.7,114.6,114.2,114.7,114.7,116,116.3,116.4,116.6,118.1,117.2,108.3,109.5,110.5,110.6,111.2,111.1,111,112.4,112.5,112.4,111.8,111.6,112.9,112.8,113.7,113.8,114,113.8,113.9,114.4,114.4,114.5,113.8,114.3,115,115.4,115.3,114.9,114.3,114.5,115.5,115.8,115.8,116,114.9,114.1,114.1,113.5,115,114.7,115.4,116.1,116.6,117.2,118.2,118,117.7,118.5,117.5,118,117.7,116.3,115,115.7,113.6,114.8,114.9,117.3,117.3,117.7,120,119.6,119.2,117.3,117.5,119,112.5,118.9,118.4,119.4,120.6,118.6,122,122.6,120.6,117.4,116.4,122.2,121,122.4,124.9,126.1,124.5,123.2,126.4,123.9,116,126.6,125.9,126.6,116.7,126.4,129,128.7,128.4,129.2,133.3,128.9,132.7,127.7,131.8,133.9) > par1 = '4' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > par1 <- as.numeric(par1) > (n <- length(x)) [1] 144 > (np <- floor(n / par1)) [1] 36 > arr <- array(NA,dim=c(par1,np)) > j <- 0 > k <- 1 > for (i in 1:(np*par1)) + { + j = j + 1 + arr[j,k] <- x[i] + if (j == par1) { + j = 0 + k=k+1 + } + } > arr [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [1,] 96.1 98.9 101.6 104.6 106.1 108.1 108.9 110.9 114.6 116.0 118.1 110.5 [2,] 96.5 100.2 102.4 104.5 107.6 108.1 109.8 111.1 114.2 116.3 117.2 110.6 [3,] 96.9 101.2 103.7 104.5 107.7 108.0 109.9 112.2 114.7 116.4 108.3 111.2 [4,] 97.8 101.0 103.7 105.6 108.3 108.2 109.8 112.7 114.7 116.6 109.5 111.1 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 111.0 111.8 113.7 113.9 113.8 115.3 115.5 114.9 115.0 116.6 117.7 117.7 [2,] 112.4 111.6 113.8 114.4 114.3 114.9 115.8 114.1 114.7 117.2 118.5 116.3 [3,] 112.5 112.9 114.0 114.4 115.0 114.3 115.8 114.1 115.4 118.2 117.5 115.0 [4,] 112.4 112.8 113.8 114.5 115.4 114.5 116.0 113.5 116.1 118.0 118.0 115.7 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [1,] 113.6 117.3 119.2 112.5 120.6 120.6 121.0 124.5 116.0 116.7 128.4 132.7 [2,] 114.8 117.7 117.3 118.9 118.6 117.4 122.4 123.2 126.6 126.4 129.2 127.7 [3,] 114.9 120.0 117.5 118.4 122.0 116.4 124.9 126.4 125.9 129.0 133.3 131.8 [4,] 117.3 119.6 119.0 119.4 122.6 122.2 126.1 123.9 126.6 128.7 128.9 133.9 > arr.mean <- array(NA,dim=np) > arr.sd <- array(NA,dim=np) > arr.range <- array(NA,dim=np) > for (j in 1:np) + { + arr.mean[j] <- mean(arr[,j],na.rm=TRUE) + arr.sd[j] <- sd(arr[,j],na.rm=TRUE) + arr.range[j] <- max(arr[,j],na.rm=TRUE) - min(arr[,j],na.rm=TRUE) + } > arr.mean [1] 96.825 100.325 102.850 104.800 107.425 108.100 109.600 111.725 114.550 [10] 116.325 113.275 110.850 112.075 112.275 113.825 114.300 114.625 114.750 [19] 115.775 114.150 115.300 117.500 117.925 116.175 115.150 118.650 118.250 [28] 117.300 120.950 119.150 123.600 124.500 123.775 125.200 129.950 131.525 > arr.sd [1] 0.72743843 1.04363148 1.03440804 0.53541261 0.93585968 0.08164966 [7] 0.46904158 0.86554414 0.23804761 0.25000000 5.08879488 0.35118846 [13] 0.71821538 0.67019898 0.12583057 0.27080128 0.71355915 0.44347116 [19] 0.20615528 0.57445626 0.60553007 0.73936910 0.43493295 1.14709779 [25] 1.55026879 1.34783777 0.98826447 3.22593656 1.77670106 2.70985854 [31] 2.31948270 1.37355985 5.19382646 5.78446195 2.25757983 2.69118933 > arr.range [1] 1.7 2.3 2.1 1.1 2.2 0.2 1.0 1.8 0.5 0.6 9.8 0.7 1.5 1.3 0.3 [16] 0.6 1.6 1.0 0.5 1.4 1.4 1.6 1.0 2.7 3.7 2.7 1.9 6.9 4.0 5.8 [31] 5.1 3.2 10.6 12.3 4.9 6.2 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -9.33089 0.09302 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -32.197 6.754 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -20.3367 0.2023 > postscript(file="/var/www/html/freestat/rcomp/tmp/1lodu1291483324.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.mean,arr.sd,main='Standard Deviation-Mean Plot',xlab='mean',ylab='standard deviation') > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/2lodu1291483324.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(arr.mean,arr.range,main='Range-Mean Plot',xlab='mean',ylab='range') > dev.off() null device 1 > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Standard Deviation-Mean Plot',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Section',header=TRUE) > a<-table.element(a,'Mean',header=TRUE) > a<-table.element(a,'Standard Deviation',header=TRUE) > a<-table.element(a,'Range',header=TRUE) > a<-table.row.end(a) > for (j in 1:np) { + a<-table.row.start(a) + a<-table.element(a,j,header=TRUE) + a<-table.element(a,arr.mean[j]) + a<-table.element(a,arr.sd[j] ) + a<-table.element(a,arr.range[j] ) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/freestat/rcomp/tmp/37pb01291483324.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Regression: S.E.(k) = alpha + beta * Mean(k)',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'alpha',header=TRUE) > a<-table.element(a,lm1$coefficients[[1]]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'beta',header=TRUE) > a<-table.element(a,lm1$coefficients[[2]]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,summary(lm1)$coefficients[2,2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,summary(lm1)$coefficients[2,3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'p-value',header=TRUE) > a<-table.element(a,summary(lm1)$coefficients[2,4]) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/freestat/rcomp/tmp/4apa61291483324.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Regression: ln S.E.(k) = alpha + beta * ln Mean(k)',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'alpha',header=TRUE) > a<-table.element(a,lnlm1$coefficients[[1]]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'beta',header=TRUE) > a<-table.element(a,lnlm1$coefficients[[2]]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,summary(lnlm1)$coefficients[2,2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'T-STAT',header=TRUE) > a<-table.element(a,summary(lnlm1)$coefficients[2,3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'p-value',header=TRUE) > a<-table.element(a,summary(lnlm1)$coefficients[2,4]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Lambda',header=TRUE) > a<-table.element(a,1-lnlm1$coefficients[[2]]) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/freestat/rcomp/tmp/51tg11291483324.tab") > > try(system("convert tmp/1lodu1291483324.ps tmp/1lodu1291483324.png",intern=TRUE)) character(0) > try(system("convert tmp/2lodu1291483324.ps tmp/2lodu1291483324.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.841 0.420 0.911