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. 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(0.24,0.23,0.23,0.24,0.23,0.23,0.25,0.21,0.26,0.25,0.24,0.24,0.27,0.25,0.26,0.29,0.24,0.26,0.24,0.26,0.25,0.26,0.24,0.21,0.20,0.22,0.20,0.21,0.20,0.19,0.20,0.20,0.21,0.24,0.22,0.19,0.23,0.23,0.23,0.22,0.23,0.25,0.25,0.22,0.25,0.25,0.24,0.19,0.24,0.26,0.24,0.24,0.25,0.23,0.27,0.24,0.26,0.27,0.29,0.28,0.32,0.29,0.27,0.26,0.28,0.31,0.29,0.31,0.31,0.32,0.32,0.26,0.31,0.31,0.31,0.31,0.29,0.27,0.30,0.27,0.27,0.30,0.28,0.24,0.28,0.28,0.33,0.28,0.29,0.25,0.31,0.29,0.37,0.31,0.29,0.28,0.30,0.32,0.31,0.28,0.29,0.29,0.28,0.26,0.28,0.30,0.33,0.31,0.37,0.36,0.37,0.37,0.36,0.33,0.33,0.40,0.32,0.39,0.39,0.37,0.37,0.30,0.33,0.33,0.34,0.35,0.34,0.37,0.37,0.37,0.36,0.32,0.33,0.35,0.36,0.35,0.37,0.35,0.32,0.33,0.28,0.32,0.35,0.30,0.32,0.32,0.32,0.32,0.36,0.31,0.26,0.33,0.31,0.34,0.33,0.38,0.32,0.30,0.32,0.33,0.34,0.29,0.33,0.36,0.32,0.32,0.32,0.31,0.30,0.34,0.34,0.30,0.28,0.25,0.27,0.33,0.28,0.33,0.32,0.27,0.27,0.28,0.27,0.27,0.25,0.25,0.22,0.27) > 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] 188 > (np <- floor(n / par1)) [1] 15 > 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] [1,] 0.24 0.27 0.20 0.23 0.24 0.32 0.31 0.28 0.30 0.37 0.37 0.33 0.32 [2,] 0.23 0.25 0.22 0.23 0.26 0.29 0.31 0.28 0.32 0.36 0.30 0.35 0.32 [3,] 0.23 0.26 0.20 0.23 0.24 0.27 0.31 0.33 0.31 0.37 0.33 0.36 0.32 [4,] 0.24 0.29 0.21 0.22 0.24 0.26 0.31 0.28 0.28 0.37 0.33 0.35 0.32 [5,] 0.23 0.24 0.20 0.23 0.25 0.28 0.29 0.29 0.29 0.36 0.34 0.37 0.36 [6,] 0.23 0.26 0.19 0.25 0.23 0.31 0.27 0.25 0.29 0.33 0.35 0.35 0.31 [7,] 0.25 0.24 0.20 0.25 0.27 0.29 0.30 0.31 0.28 0.33 0.34 0.32 0.26 [8,] 0.21 0.26 0.20 0.22 0.24 0.31 0.27 0.29 0.26 0.40 0.37 0.33 0.33 [9,] 0.26 0.25 0.21 0.25 0.26 0.31 0.27 0.37 0.28 0.32 0.37 0.28 0.31 [10,] 0.25 0.26 0.24 0.25 0.27 0.32 0.30 0.31 0.30 0.39 0.37 0.32 0.34 [11,] 0.24 0.24 0.22 0.24 0.29 0.32 0.28 0.29 0.33 0.39 0.36 0.35 0.33 [12,] 0.24 0.21 0.19 0.19 0.28 0.26 0.24 0.28 0.31 0.37 0.32 0.30 0.38 [,14] [,15] [1,] 0.32 0.30 [2,] 0.30 0.34 [3,] 0.32 0.34 [4,] 0.33 0.30 [5,] 0.34 0.28 [6,] 0.29 0.25 [7,] 0.33 0.27 [8,] 0.36 0.33 [9,] 0.32 0.28 [10,] 0.32 0.33 [11,] 0.32 0.32 [12,] 0.31 0.27 > 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] 0.2375000 0.2525000 0.2066667 0.2325000 0.2558333 0.2950000 0.2883333 [8] 0.2966667 0.2958333 0.3633333 0.3458333 0.3341667 0.3250000 0.3216667 [15] 0.3008333 > arr.sd [1] 0.01288057 0.01959824 0.01435481 0.01764550 0.01880925 0.02315953 [7] 0.02249579 0.03055050 0.01975225 0.02534609 0.02314316 0.02609714 [13] 0.02907670 0.01800673 0.03088346 > arr.range [1] 0.05 0.08 0.05 0.06 0.06 0.06 0.07 0.12 0.07 0.08 0.07 0.09 0.12 0.07 0.09 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -0.001531 0.081525 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -2.382 1.169 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 0.003517 0.249846 > postscript(file="/var/www/html/rcomp/tmp/1kfd11228738068.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/2a6ra1228738068.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/34umm1228738068.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/4kb441228738068.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/5bni01228738068.tab") > > system("convert tmp/1kfd11228738068.ps tmp/1kfd11228738068.png") > system("convert tmp/2a6ra1228738068.ps tmp/2a6ra1228738068.png") > > > proc.time() user system elapsed 0.524 0.299 0.630