R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(10 + ,10 + ,10 + ,10 + ,10 + ,9.94 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,10.06 + ,9.94 + ,9.94 + ,9.94 + ,9.94 + ,9.94 + ,9.94 + ,10.06 + ,10.06 + ,9.94 + ,10.06 + ,10.06 + ,10.06 + ,10.18 + ,10.28 + ,10.28 + ,10.18 + ,10.28 + ,10.28 + ,10.28 + ,10.18 + ,10.28 + ,10.28 + ,10.18 + ,10.18 + ,10.18 + ,10.28 + ,10.28 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.28 + ,10.28 + ,10.28 + ,10.18 + ,10.18 + ,10.18 + ,10.28 + ,10.18 + ,10.18 + ,10.28 + ,10.18 + ,10.18 + ,10.18 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.18 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.18 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.18 + ,10.28 + ,10.28 + ,10.28 + ,10.18 + ,10.18 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.28 + ,10.18 + ,10.28 + ,10.28 + ,10.28 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.34 + ,10.34 + ,10.34 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.34 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.34 + ,10.34 + ,10.34 + ,10.34 + ,10.42 + ,10.42 + ,10.34 + ,10.34 + ,10.34 + ,10.42 + ,10.42 + ,10.42 + ,10.34 + ,10.34 + ,10.34 + ,10.34 + ,10.34 + ,10.42 + ,10.42 + ,10.42 + ,10.34 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.34 + ,10.34 + ,10.34 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.42 + ,10.34 + ,10.34 + ,10.42 + ,10.42 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.49 + ,10.49 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.49 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.49 + ,10.49 + ,10.55 + ,10.55 + ,10.55 + ,10.49 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.55 + ,10.49 + ,10.49 + ,10.49 + ,10.55 + ,10.55 + ,10.55 + ,10.49 + ,10.55 + ,10.55 + ,10.55 + ,10.63 + ,10.63 + ,10.63 + ,10.63 + ,10.63 + ,10.57 + ,10.63 + ,10.63 + ,10.63 + ,10.63 + ,10.57 + ,10.57 + ,10.57 + ,10.63 + ,10.63 + ,10.63 + ,10.63 + ,10.57 + ,10.63 + ,10.63 + ,10.57 + ,10.63 + ,10.63 + ,10.63 + ,10.63 + ,10.57 + ,10.63 + ,10.6 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.6 + ,10.6 + ,10.6 + ,10.6 + ,10.7 + ,10.7 + ,10.6 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.7 + ,10.8 + ,10.8 + ,10.8 + ,10.8 + ,10.7 + ,10.7 + ,10.7 + ,10.85 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.85 + ,10.85 + ,10.85 + ,10.85 + ,10.85 + ,10.85 + ,10.85 + ,10.85 + ,10.85 + ,10.85 + ,10.75 + ,10.75 + ,10.85 + ,10.85 + ,10.85 + ,10.85 + ,10.75 + ,10.75 + ,10.75 + ,10.75 + ,10.75) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '0.95' > par6 = 'White Noise' > par5 = '12' > par4 = '0' > par3 = '1' > par2 = '1' > par1 = '12' > ylab = '' > xlab = '' > main = '' > par1 <- 30 > (n <- length(x)) [1] 350 > (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,] 10.00 10.06 10.18 10.28 10.42 10.42 10.34 10.55 10.55 10.63 10.70 [2,] 10.00 10.06 10.18 10.28 10.34 10.42 10.34 10.49 10.49 10.57 10.70 [3,] 10.00 10.18 10.28 10.28 10.34 10.34 10.34 10.49 10.49 10.63 10.70 [4,] 10.00 10.28 10.18 10.28 10.34 10.34 10.42 10.55 10.49 10.63 10.70 [5,] 10.00 10.28 10.18 10.18 10.42 10.34 10.42 10.55 10.55 10.63 10.70 [6,] 9.94 10.18 10.18 10.28 10.42 10.42 10.42 10.55 10.55 10.63 10.70 [7,] 10.06 10.28 10.28 10.28 10.42 10.42 10.42 10.55 10.55 10.57 10.70 [8,] 10.06 10.28 10.28 10.28 10.42 10.42 10.42 10.55 10.49 10.63 10.70 [9,] 10.06 10.28 10.28 10.18 10.34 10.34 10.42 10.55 10.55 10.60 10.70 [10,] 10.06 10.18 10.28 10.18 10.42 10.34 10.42 10.49 10.55 10.70 10.70 [11,] 10.06 10.28 10.28 10.28 10.42 10.34 10.42 10.55 10.55 10.70 10.80 [12,] 10.06 10.28 10.28 10.28 10.42 10.34 10.42 10.55 10.63 10.70 10.80 [13,] 10.06 10.18 10.18 10.28 10.42 10.34 10.42 10.55 10.63 10.70 10.80 [14,] 10.06 10.18 10.18 10.28 10.42 10.42 10.42 10.55 10.63 10.70 10.80 [15,] 10.06 10.18 10.18 10.28 10.42 10.42 10.42 10.55 10.63 10.70 10.70 [16,] 10.06 10.28 10.18 10.28 10.42 10.42 10.42 10.55 10.63 10.70 10.70 [17,] 10.06 10.28 10.18 10.28 10.42 10.34 10.42 10.49 10.57 10.70 10.70 [18,] 10.06 10.18 10.18 10.18 10.42 10.42 10.34 10.49 10.63 10.70 10.85 [19,] 10.06 10.18 10.18 10.28 10.42 10.42 10.34 10.55 10.63 10.70 10.75 [20,] 10.06 10.18 10.18 10.28 10.42 10.42 10.42 10.55 10.63 10.60 10.75 [21,] 9.94 10.18 10.18 10.28 10.42 10.42 10.42 10.55 10.63 10.60 10.75 [22,] 9.94 10.18 10.28 10.42 10.42 10.42 10.55 10.49 10.57 10.60 10.75 [23,] 9.94 10.18 10.28 10.42 10.42 10.42 10.55 10.55 10.57 10.60 10.75 [24,] 9.94 10.28 10.28 10.42 10.42 10.42 10.55 10.55 10.57 10.70 10.75 [25,] 9.94 10.28 10.28 10.42 10.42 10.42 10.55 10.55 10.63 10.70 10.75 [26,] 9.94 10.28 10.28 10.42 10.42 10.42 10.55 10.55 10.63 10.60 10.75 [27,] 10.06 10.18 10.28 10.42 10.34 10.42 10.55 10.55 10.63 10.70 10.75 [28,] 10.06 10.18 10.28 10.42 10.34 10.42 10.55 10.55 10.63 10.70 10.75 [29,] 9.94 10.18 10.28 10.42 10.34 10.42 10.55 10.55 10.57 10.70 10.75 [30,] 10.06 10.28 10.18 10.42 10.34 10.42 10.55 10.55 10.63 10.70 10.85 > 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] 10.01800 10.21533 10.23000 10.30867 10.39867 10.39600 10.44567 10.53800 [9] 10.58267 10.65733 10.74167 > arr.sd [1] 0.05261441 0.06468669 0.05085476 0.08131392 0.03598212 0.03728733 [7] 0.07527803 0.02441029 0.05051004 0.04863186 0.04564355 > arr.range [1] 0.12 0.22 0.10 0.24 0.08 0.08 0.21 0.06 0.14 0.13 0.15 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 0.30379 -0.02422 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 9.159 -5.197 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 0.50733 -0.03537 > postscript(file="/var/www/rcomp/tmp/1ymyn1293527764.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/www/rcomp/tmp/2ymyn1293527764.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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3jnet1293527764.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/rcomp/tmp/45nvh1293527764.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/rcomp/tmp/51ft81293527764.tab") > > try(system("convert tmp/1ymyn1293527764.ps tmp/1ymyn1293527764.png",intern=TRUE)) character(0) > try(system("convert tmp/2ymyn1293527764.ps tmp/2ymyn1293527764.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.64 0.21 0.84