R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(106.07,106.07,106.07,106.07,106.07,106.2,107.5,108.31,108.53,108.61,108.62,108.62,108.62,108.62,110.1,110.74,110.77,110.77,110.78,110.78,110.78,110.84,110.84,110.84,110.84,110.84,111.01,112.66,114.04,114.16,114.2,114.2,114.23,114.23,114.23,114.23,114.23,114.23,115.97,116.96,117.08,117.08,117.08,117.63,119.12,119.47,119.5,119.52,119.49,119.49,119.5,119.5,119.56,122.35,122.92,122.92,123.04,123.04,123.04,123.06,123.33,128.21,129.57,129.79,131.66,135.01,136.01,136.31,136.37,136.4,136.4,136.4,137.34,142.18,143.79,144.08,144.08,144.09,144.09,144.11,144.11,144.15,144.15,144.16,144.2,144.38,144.38,144.28,144.46,144.53,144.53,145.34,147.98,150.42,150.53,150.64) > par1 = '12' > #'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] 96 > (np <- floor(n / par1)) [1] 8 > 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] [1,] 106.07 108.62 110.84 114.23 119.49 123.33 137.34 144.20 [2,] 106.07 108.62 110.84 114.23 119.49 128.21 142.18 144.38 [3,] 106.07 110.10 111.01 115.97 119.50 129.57 143.79 144.38 [4,] 106.07 110.74 112.66 116.96 119.50 129.79 144.08 144.28 [5,] 106.07 110.77 114.04 117.08 119.56 131.66 144.08 144.46 [6,] 106.20 110.77 114.16 117.08 122.35 135.01 144.09 144.53 [7,] 107.50 110.78 114.20 117.08 122.92 136.01 144.09 144.53 [8,] 108.31 110.78 114.20 117.63 122.92 136.31 144.11 145.34 [9,] 108.53 110.78 114.23 119.12 123.04 136.37 144.11 147.98 [10,] 108.61 110.84 114.23 119.47 123.04 136.40 144.15 150.42 [11,] 108.62 110.84 114.23 119.50 123.04 136.40 144.15 150.53 [12,] 108.62 110.84 114.23 119.52 123.06 136.40 144.16 150.64 > 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] 107.2283 110.3733 113.2392 117.3225 121.4925 132.9550 143.3608 146.3058 > arr.sd [1] 1.2242536 0.8432441 1.4795359 1.8774263 1.7618901 4.3733334 1.9756125 [8] 2.7462552 > arr.range [1] 2.55 2.22 3.39 5.29 3.57 13.07 6.82 6.44 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -3.68920 0.04615 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -14.225 3.079 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -13.1490 0.1497 > postscript(file="/var/www/html/rcomp/tmp/13lmn1243956941.ps",horizontal=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/rcomp/tmp/2nxhn1243956941.ps",horizontal=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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/rcomp/tmp/3wycj1243956941.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/rcomp/tmp/4rtzg1243956941.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/rcomp/tmp/51vv81243956941.tab") > system("convert tmp/13lmn1243956941.ps tmp/13lmn1243956941.png") > system("convert tmp/2nxhn1243956941.ps tmp/2nxhn1243956941.png") > > > proc.time() user system elapsed 0.513 0.307 0.621