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(8.29,8.27,8.27,8.43,8.46,8.48,8.46,8.46,8.43,8.4,8.38,8.3,8.39,8.53,8.52,8.54,8.62,8.52,8.49,8.44,8.31,8.26,8.21,8.03,7.89,7.83,7.85,7.84,7.88,8.01,8.08,8.11,8.11,8.07,8.06,7.95,7.95,8.07,8.17,8.21,8.2,8.19,8.18,8.16,8.17,8.17,8.19,8.01,8.04,8.13,8.14,8.17,8.25,8.27,8.27,8.26,8.24,8.21,8.25,8.06,8.16,8.32,8.43,8.39,8.41,8.45,8.43,8.52,8.52,8.51,8.56,8.36,8.4,8.44,8.5,8.31,8.38,8.45,8.42,8.46,8.45,8.32,8.4,8.18) > 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] 84 > (np <- floor(n / par1)) [1] 21 > 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] [,13] [,14] [1,] 8.29 8.46 8.43 8.39 8.62 8.31 7.89 7.88 8.11 7.95 8.20 8.17 8.04 8.25 [2,] 8.27 8.48 8.40 8.53 8.52 8.26 7.83 8.01 8.07 8.07 8.19 8.17 8.13 8.27 [3,] 8.27 8.46 8.38 8.52 8.49 8.21 7.85 8.08 8.06 8.17 8.18 8.19 8.14 8.27 [4,] 8.43 8.46 8.30 8.54 8.44 8.03 7.84 8.11 7.95 8.21 8.16 8.01 8.17 8.26 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] 8.24 8.16 8.41 8.52 8.40 8.38 8.45 [2,] 8.21 8.32 8.45 8.51 8.44 8.45 8.32 [3,] 8.25 8.43 8.43 8.56 8.50 8.42 8.40 [4,] 8.06 8.39 8.52 8.36 8.31 8.46 8.18 > 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] 8.3150 8.4650 8.3775 8.4950 8.5175 8.2025 7.8525 8.0200 8.0475 8.1000 [11] 8.1825 8.1350 8.1200 8.2625 8.1900 8.3250 8.4525 8.4875 8.4125 8.4275 [21] 8.3375 > arr.sd [1] 0.077244202 0.010000000 0.055602758 0.070474582 0.075883683 0.122031417 [7] 0.026299556 0.102306728 0.068495742 0.116045968 0.017078251 0.083864971 [13] 0.055976185 0.009574271 0.088317609 0.119023807 0.047871355 0.087702147 [19] 0.079739158 0.035939764 0.117862915 > arr.range [1] 0.16 0.02 0.13 0.15 0.18 0.28 0.06 0.23 0.16 0.26 0.04 0.18 0.13 0.02 0.19 [16] 0.27 0.11 0.20 0.19 0.08 0.27 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 0.150921 -0.009797 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -0.8159 -0.9717 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 0.31622 -0.01917 > postscript(file="/var/wessaorg/rcomp/tmp/1kfzn1322648958.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/2jlyb1322648958.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/3c55k1322648958.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/491ef1322648958.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/5tfw41322648958.tab") > > try(system("convert tmp/1kfzn1322648958.ps tmp/1kfzn1322648958.png",intern=TRUE)) character(0) > try(system("convert tmp/2jlyb1322648958.ps tmp/2jlyb1322648958.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.764 0.107 0.896