R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(162.9,164.7,165,167.2,168.6,169.5,169.8,171.9,172,173.7,173.9,175.9,175.6,176.1,176.3,179.4,179.7,179.9,180.4,182.5,183.6,183.9,184.5,187.6,188,188.5,188.6,191.9,193.5,194.9,194.9,196.2,196.2,198,198.6,201.3,203.5,204.1,204.8,206.5,207.8,208.6,209.7,210,211.7,212.4,213.7,214.8,216.4,217.5,218.6,220.4,221.8,222.5,223.4,225.5,226.5,227.8,228.5,229.1,229.9,230.8,231.9,236,237.5,239.1,240.5,241.4,243.2,243.6,244.3,244.5,245.1,245.8,246.7,247.7,248.5) > 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] 77 > (np <- floor(n / par1)) [1] 19 > 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,] 162.9 168.6 172.0 175.6 179.7 183.6 188.0 193.5 196.2 203.5 207.8 211.7 [2,] 164.7 169.5 173.7 176.1 179.9 183.9 188.5 194.9 198.0 204.1 208.6 212.4 [3,] 165.0 169.8 173.9 176.3 180.4 184.5 188.6 194.9 198.6 204.8 209.7 213.7 [4,] 167.2 171.9 175.9 179.4 182.5 187.6 191.9 196.2 201.3 206.5 210.0 214.8 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [1,] 216.4 221.8 226.5 229.9 237.5 243.2 245.1 [2,] 217.5 222.5 227.8 230.8 239.1 243.6 245.8 [3,] 218.6 223.4 228.5 231.9 240.5 244.3 246.7 [4,] 220.4 225.5 229.1 236.0 241.4 244.5 247.7 > 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] 164.950 169.950 173.875 176.850 180.625 184.900 189.250 194.875 198.525 [10] 204.725 209.025 213.150 218.225 223.300 227.975 232.150 239.625 243.900 [19] 246.325 > arr.sd [1] 1.7635192 1.3964240 1.5966110 1.7253019 1.2841988 1.8384776 1.7860571 [8] 1.1026483 2.1124630 1.2971122 1.0144785 1.3771952 1.7056279 1.6062378 [15] 1.1176612 2.6938201 1.7036725 0.6055301 1.1265730 > arr.range [1] 4.3 3.3 3.9 3.8 2.8 4.0 3.9 2.7 5.1 3.0 2.2 3.1 4.0 3.7 2.6 6.1 3.9 1.3 2.6 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 2.186807 -0.003262 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 4.2383 -0.7276 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 5.23697 -0.00853 > postscript(file="/var/wessaorg/rcomp/tmp/1l6jm1323176194.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/wessaorg/rcomp/tmp/277vb1323176194.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/3uoqo1323176194.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/wessaorg/rcomp/tmp/4i3lx1323176194.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/wessaorg/rcomp/tmp/5jl6r1323176194.tab") > > try(system("convert tmp/1l6jm1323176194.ps tmp/1l6jm1323176194.png",intern=TRUE)) character(0) > try(system("convert tmp/277vb1323176194.ps tmp/277vb1323176194.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.607 0.108 0.724