R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(100.00,100.42,100.50,101.14,101.98,102.31,103.27,103.80,103.46,105.06,106.08,106.74,107.35,108.96,109.85,109.81,109.99,111.60,112.74,112.78,113.66,115.37,116.26,116.24,116.73,118.76,119.78,120.23,121.48,124.07,125.82,126.92,128.48,131.44,133.51,134.58,136.68,140.10,142.45,143.91,146.19,149.84,152.31,153.62,155.79,159.89,163.21,165.32,167.68,171.79,175.38,177.81,181.09,186.48,191.07,194.23,197.82,204.41,209.26,212.24,214.88,218.87,219.86,219.75,220.89,224.02,222.27,217.27,213.23,212.44,207.87,199.46,198.19,199.77,200.10,195.76,191.27,195.79,192.7) > 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] 79 > (np <- floor(n / par1)) [1] 19 > 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] [1,] 100.00 101.98 103.46 107.35 109.99 113.66 116.73 121.48 128.48 136.68 [2,] 100.42 102.31 105.06 108.96 111.60 115.37 118.76 124.07 131.44 140.10 [3,] 100.50 103.27 106.08 109.85 112.74 116.26 119.78 125.82 133.51 142.45 [4,] 101.14 103.80 106.74 109.81 112.78 116.24 120.23 126.92 134.58 143.91 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [1,] 146.19 155.79 167.68 181.09 197.82 214.88 220.89 213.23 198.19 [2,] 149.84 159.89 171.79 186.48 204.41 218.87 224.02 212.44 199.77 [3,] 152.31 163.21 175.38 191.07 209.26 219.86 222.27 207.87 200.10 [4,] 153.62 165.32 177.81 194.23 212.24 219.75 217.27 199.46 195.76 > 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] 100.5150 102.8400 105.3350 108.9925 111.7775 115.3825 118.8750 124.5725 [9] 132.0025 140.7850 150.4900 161.0525 173.1650 188.2175 205.9325 218.3400 [17] 221.1125 208.2500 198.4550 > arr.sd [1] 0.4708503 0.8420214 1.4283207 1.1693980 1.3112430 1.2209934 1.5566310 [8] 2.3722756 2.6857944 3.1547900 3.2670986 4.1597947 4.4142987 5.7185976 [15] 6.2978164 2.3488295 2.8640109 6.3183595 1.9806144 > arr.range [1] 1.14 1.82 3.28 2.50 2.79 2.60 3.50 5.44 6.10 7.23 7.43 9.53 [13] 10.13 13.14 14.42 4.98 6.75 13.77 4.34 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -1.66162 0.02950 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -8.947 1.959 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -3.75722 0.06662 > postscript(file="/var/www/html/rcomp/tmp/1gz5z1292674772.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/html/rcomp/tmp/2gz5z1292674772.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/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/31h351292674772.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/45ikt1292674772.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/58jiz1292674772.tab") > > try(system("convert tmp/1gz5z1292674772.ps tmp/1gz5z1292674772.png",intern=TRUE)) character(0) > try(system("convert tmp/2gz5z1292674772.ps tmp/2gz5z1292674772.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.519 0.316 2.960