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,102.04,102.51,102.71,103.00,103.39,102.32,103.88,104.65,104.46,104.65,104.36,102.71,104.55,104.76,105.72,106.20,106.50,105.14,106.50,106.69,106.50,106.50,106.39,105.43,107.18,107.37,107.46,107.66,107.37,106.30,107.85,107.95,107.85,107.66,107.76,106.69,108.92,109.22,109.02,108.62,109.02,107.76,109.60,109.80,109.41,109.60,109.60,108.15,110.18,110.27,110.87,111.25,111.15,109.99,111.83,111.73,112.31,112.12,111.73,110.27,112.71,113.38,113.57,113.77,114.15,112.99,115.03,115.03,114.84,114.75,114.84,113.32,115.92,115.84,116.49,116.90,116.99,115.74,117.73,117.17,116.83,117.08,117.23,115.25,117.98,117.97,118.56,118.42,118.51,117.25,119.08,118.85,119.41,120.43,120.87,119.31,122.24,123.14,123.39,124.46,125.33,124.17,125.48,125.35,125.15,124.31,124.14,121.81,124.62,123.93,124.29,124.16,124.02,122.00,124.58,124.06) > 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] 117 > (np <- floor(n / par1)) [1] 9 > 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] [1,] 100.00 102.71 105.43 106.69 108.15 110.27 113.32 115.25 119.31 [2,] 102.04 104.55 107.18 108.92 110.18 112.71 115.92 117.98 122.24 [3,] 102.51 104.76 107.37 109.22 110.27 113.38 115.84 117.97 123.14 [4,] 102.71 105.72 107.46 109.02 110.87 113.57 116.49 118.56 123.39 [5,] 103.00 106.20 107.66 108.62 111.25 113.77 116.90 118.42 124.46 [6,] 103.39 106.50 107.37 109.02 111.15 114.15 116.99 118.51 125.33 [7,] 102.32 105.14 106.30 107.76 109.99 112.99 115.74 117.25 124.17 [8,] 103.88 106.50 107.85 109.60 111.83 115.03 117.73 119.08 125.48 [9,] 104.65 106.69 107.95 109.80 111.73 115.03 117.17 118.85 125.35 [10,] 104.46 106.50 107.85 109.41 112.31 114.84 116.83 119.41 125.15 [11,] 104.65 106.50 107.66 109.60 112.12 114.75 117.08 120.43 124.31 [12,] 104.36 106.39 107.76 109.60 111.73 114.84 117.23 120.87 124.14 > 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] 103.1642 105.6800 107.3200 108.9383 110.9650 113.7775 116.4367 118.5483 [9] 123.8725 > arr.sd [1] 1.3730355 1.1955067 0.7410190 0.9003114 1.1739715 1.3732253 1.1581359 [8] 1.4549966 1.7443630 > arr.range [1] 4.65 3.98 2.52 3.11 4.16 4.76 4.41 5.62 6.17 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -1.84883 0.02751 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -11.179 2.408 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -9.1705 0.1209 > postscript(file="/var/www/html/rcomp/tmp/1dze41260470059.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/rcomp/tmp/28ybz1260470059.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/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/342vw1260470059.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/4wbth1260470059.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/5adf61260470059.tab") > system("convert tmp/1dze41260470059.ps tmp/1dze41260470059.png") > system("convert tmp/28ybz1260470059.ps tmp/28ybz1260470059.png") > > > proc.time() user system elapsed 0.513 0.289 0.666