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(106.61,107.86,108.07,109.68,108.57,108.08,109.8,110.7,110.72,109.85,109.71,110,110.87,111.16,110.63,110.26,110.79,111.75,111.75,112.31,112.29,111.86,111.22,112.42,111.94,112.77,113.99,114.22,112.38,114.98,115.94,117.63,117.76,118.11,120.88,121.87,122.34,122.42,122.17,121.99,124.96,125.94,126.59,127.11,125.44,125.53,125.35,124.3,123.62,124,124.47,126.89,124.87,124.55,125.31,126.02,125.31,125.3,123.83,124.49,124.92,125.77,127.27,127.35,126.05,126.84,127.75,126.78,126.98,127.89,127.9,128.06,125.39,128.13,127.97,127.56,126.89,127.8,128.05,128.98,128.55,129.35,129.97,130.89,129.8,132.32,131.1,131.44,132.55,133.35,132.53,131.11,130.02,128.91,129.98,130.91) > 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] 96 > (np <- floor(n / par1)) [1] 24 > 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,] 106.61 108.57 110.72 110.87 110.79 112.29 111.94 112.38 117.76 122.34 [2,] 107.86 108.08 109.85 111.16 111.75 111.86 112.77 114.98 118.11 122.42 [3,] 108.07 109.80 109.71 110.63 111.75 111.22 113.99 115.94 120.88 122.17 [4,] 109.68 110.70 110.00 110.26 112.31 112.42 114.22 117.63 121.87 121.99 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 124.96 125.44 123.62 124.87 125.31 124.92 126.05 126.98 125.39 126.89 [2,] 125.94 125.53 124.00 124.55 125.30 125.77 126.84 127.89 128.13 127.80 [3,] 126.59 125.35 124.47 125.31 123.83 127.27 127.75 127.90 127.97 128.05 [4,] 127.11 124.30 126.89 126.02 124.49 127.35 126.78 128.06 127.56 128.98 [,21] [,22] [,23] [,24] [1,] 128.55 129.80 132.55 130.02 [2,] 129.35 132.32 133.35 128.91 [3,] 129.97 131.10 132.53 129.98 [4,] 130.89 131.44 131.11 130.91 > 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] 108.0550 109.2875 110.0700 110.7300 111.6500 111.9475 113.2300 115.2325 [9] 119.6550 122.2300 126.1500 125.1550 124.7450 125.1875 124.7325 126.3275 [17] 126.8550 127.7075 127.2625 127.9300 129.6900 131.1650 132.3850 129.9550 > arr.sd [1] 1.2605422 1.1875289 0.4492215 0.3809637 0.6311894 0.5408250 1.0697975 [8] 2.1946203 2.0318218 0.1909625 0.9265348 0.5747173 1.4716544 0.6364681 [15] 0.7138802 1.1868270 0.6963955 0.4912145 1.2712035 0.8593408 0.9888714 [22] 1.0451635 0.9318619 0.8183113 > arr.range [1] 3.07 2.62 1.01 0.90 1.52 1.20 2.28 5.25 4.11 0.43 2.15 1.23 3.27 1.47 1.48 [16] 2.43 1.70 1.08 2.74 2.09 2.34 2.52 2.24 2.00 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 1.195517 -0.002106 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -2.457 0.472 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 2.623656 -0.004058 > postscript(file="/var/www/html/freestat/rcomp/tmp/1uer41249375649.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/28jv41249375649.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/3of0e1249375649.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/4hyrp1249375649.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/58aiz1249375649.tab") > > system("convert tmp/1uer41249375649.ps tmp/1uer41249375649.png") > system("convert tmp/28jv41249375649.ps tmp/28jv41249375649.png") > > > proc.time() user system elapsed 0.772 0.420 0.915