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(15.22,15.27,15.31,15.33,15.42,15.49,15.65,15.67,15.69,15.83,15.92,15.99,15.94,15.96,16.03,16.09,16.04,16.23,16.2,16.2,16.26,16.28,16.27,16.29,16.3,16.37,16.39,16.42,16.43,16.37,16.37,16.39,16.48,16.51,16.5,16.54,16.52,16.56,16.61,16.75,16.75,16.79,16.82,16.84,17.14,17.25,17.28,17.3,17.34,17.44,17.48,17.55,17.59,17.66,17.67,17.64,17.68,17.72,17.78,17.83,17.88,18.11,18.16,18.27,18.29,18.35,18.35,18.38,18.41,18.41,18.42,18.43,18.48,18.54,18.65,18.66,18.69,18.72,18.72,18.73,18.84,18.83,18.91,18.91,18.94,18.97,19,19.08,19.18,19.24,19.23,19.25,19.3,19.33,19.35,19.35,19.31,19.47,19.7,19.76,19.9,19.97,20.1,20.26,20.44,20.43,20.57,20.6,20.69,20.93,20.98,21.11,21.14,21.16,21.32,21.32,21.48,21.58,21.74,21.75,21.81,21.89,22.21,22.37,22.47,22.51,22.55,22.61,22.58,22.85,22.93,22.98) > 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] 132 > (np <- floor(n / par1)) [1] 11 > 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] [1,] 15.22 15.94 16.30 16.52 17.34 17.88 18.48 18.94 19.31 20.69 21.81 [2,] 15.27 15.96 16.37 16.56 17.44 18.11 18.54 18.97 19.47 20.93 21.89 [3,] 15.31 16.03 16.39 16.61 17.48 18.16 18.65 19.00 19.70 20.98 22.21 [4,] 15.33 16.09 16.42 16.75 17.55 18.27 18.66 19.08 19.76 21.11 22.37 [5,] 15.42 16.04 16.43 16.75 17.59 18.29 18.69 19.18 19.90 21.14 22.47 [6,] 15.49 16.23 16.37 16.79 17.66 18.35 18.72 19.24 19.97 21.16 22.51 [7,] 15.65 16.20 16.37 16.82 17.67 18.35 18.72 19.23 20.10 21.32 22.55 [8,] 15.67 16.20 16.39 16.84 17.64 18.38 18.73 19.25 20.26 21.32 22.61 [9,] 15.69 16.26 16.48 17.14 17.68 18.41 18.84 19.30 20.44 21.48 22.58 [10,] 15.83 16.28 16.51 17.25 17.72 18.41 18.83 19.33 20.43 21.58 22.85 [11,] 15.92 16.27 16.50 17.28 17.78 18.42 18.91 19.35 20.57 21.74 22.93 [12,] 15.99 16.29 16.54 17.30 17.83 18.43 18.91 19.35 20.60 21.75 22.98 > 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] 15.56583 16.14917 16.42250 16.88417 17.61500 18.28833 18.72333 19.18500 [9] 20.04250 21.26667 22.48000 > arr.sd [1] 0.2634891 0.1295768 0.0714938 0.2848750 0.1426056 0.1646944 0.1341867 [8] 0.1506048 0.4300978 0.3285044 0.3697911 > arr.range [1] 0.77 0.35 0.24 0.78 0.49 0.55 0.43 0.41 1.29 1.06 1.17 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -0.35870 0.03166 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -9.109 2.574 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -1.2884 0.1072 > postscript(file="/var/www/html/freestat/rcomp/tmp/1w1h61250633872.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/freestat/rcomp/tmp/2tc9d1250633872.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/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/3bhqp1250633872.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/4b5pw1250633872.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/5r4aw1250633872.tab") > > system("convert tmp/1w1h61250633872.ps tmp/1w1h61250633872.png") > system("convert tmp/2tc9d1250633872.ps tmp/2tc9d1250633872.png") > > > proc.time() user system elapsed 0.742 0.405 0.816