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(2.98,2.98,2.98,3.03,3.07,3.08,3.08,3.08,3.08,3.08,3.08,3.08,3.08,3.08,3.12,3.15,3.15,3.15,3.15,3.16,3.19,3.20,3.20,3.20,3.21,3.21,3.21,3.21,3.21,3.28,3.30,3.30,3.30,3.30,3.30,3.30,3.30,3.45,3.49,3.50,3.54,3.64,3.67,3.67,3.68,3.68,3.68,3.68,3.70,3.83,3.87,3.87,3.87,3.87,3.87,3.87,3.87,3.87,3.87,3.88,3.88,3.88,3.88,3.88,3.88,3.89,3.89,3.91,3.95,3.99,3.99,3.99,4.00,4.00,4.00,4.00,4.00,4.00,4.00,4.00,4.06,4.07,4.07,4.07,4.07,4.07,4.30,4.44,4.52,4.52,4.52,4.53,4.53,4.53,4.53,4.53,4.53,4.53,4.53,4.61,4.63,4.63,4.63,4.63,4.63,4.63,4.63,4.63,4.63,4.63,4.66,4.73,4.73,4.72,4.7,4.74,4.74,4.74,4.76,4.88,4.88,4.88,4.88,4.89,4.97,4.97,4.97,4.97,4.97,4.97,4.97,4.97) > 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,] 2.98 3.08 3.21 3.30 3.70 3.88 4.00 4.07 4.53 4.63 4.88 [2,] 2.98 3.08 3.21 3.45 3.83 3.88 4.00 4.07 4.53 4.63 4.88 [3,] 2.98 3.12 3.21 3.49 3.87 3.88 4.00 4.30 4.53 4.66 4.88 [4,] 3.03 3.15 3.21 3.50 3.87 3.88 4.00 4.44 4.61 4.73 4.89 [5,] 3.07 3.15 3.21 3.54 3.87 3.88 4.00 4.52 4.63 4.73 4.97 [6,] 3.08 3.15 3.28 3.64 3.87 3.89 4.00 4.52 4.63 4.72 4.97 [7,] 3.08 3.15 3.30 3.67 3.87 3.89 4.00 4.52 4.63 4.70 4.97 [8,] 3.08 3.16 3.30 3.67 3.87 3.91 4.00 4.53 4.63 4.74 4.97 [9,] 3.08 3.19 3.30 3.68 3.87 3.95 4.06 4.53 4.63 4.74 4.97 [10,] 3.08 3.20 3.30 3.68 3.87 3.99 4.07 4.53 4.63 4.74 4.97 [11,] 3.08 3.20 3.30 3.68 3.87 3.99 4.07 4.53 4.63 4.76 4.97 [12,] 3.08 3.20 3.30 3.68 3.88 3.99 4.07 4.53 4.63 4.88 4.97 > 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] 3.050000 3.152500 3.260833 3.581667 3.853333 3.917500 4.022500 4.424167 [9] 4.603333 4.721667 4.940833 > arr.sd [1] 0.04451762 0.04245318 0.04521833 0.12474216 0.04978743 0.04807664 [7] 0.03333712 0.17839987 0.04458563 0.06658328 0.04316108 > arr.range [1] 0.10 0.12 0.09 0.38 0.18 0.11 0.07 0.46 0.10 0.25 0.09 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 0.0216 0.0111 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -3.5935 0.5308 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 0.04104 0.03443 > postscript(file="/var/wessaorg/rcomp/tmp/1wtpf1323894736.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/2ddp21323894736.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/351331323894736.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/4c4hp1323894736.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/5dzf51323894736.tab") > > try(system("convert tmp/1wtpf1323894736.ps tmp/1wtpf1323894736.png",intern=TRUE)) character(0) > try(system("convert tmp/2ddp21323894736.ps tmp/2ddp21323894736.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.620 0.157 0.789