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(11554.5,13182.1,14800.1,12150.7,14478.2,13253.9,12036.8,12653.2,14035.4,14571.4,15400.9,14283.2,14485.3,14196.3,15559.1,13767.4,14634,14381.1,12509.9,12122.3,13122.3,13908.7,13456.5,12441.6,12953,13057.2,14350.1,13830.2,13755.5,13574.4,12802.6,11737.3,13850.2,15081.8,13653.3,14019.1,13962,13768.7,14747.1,13858.1,13188,13693.1,12970,11392.8,13985.2,14994.7,13584.7,14257.8,13553.4,14007.3,16535.8,14721.4,13664.6,16805.9,13829.4,13735.6,15870.5,15962.4,15744.1,16083.7,14863.9,15533.1,17473.1,15925.5,15573.7,17495,14155.8,14913.9,17250.4,15879.8,17647.8,17749.9,17111.8,16934.8,20280,16238.2,17896.1,18089.3,15660,16162.4,17850.1,18520.4,18524.7,16843.7) > 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] 84 > (np <- floor(n / par1)) [1] 7 > 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] [1,] 11554.5 14485.3 12953.0 13962.0 13553.4 14863.9 17111.8 [2,] 13182.1 14196.3 13057.2 13768.7 14007.3 15533.1 16934.8 [3,] 14800.1 15559.1 14350.1 14747.1 16535.8 17473.1 20280.0 [4,] 12150.7 13767.4 13830.2 13858.1 14721.4 15925.5 16238.2 [5,] 14478.2 14634.0 13755.5 13188.0 13664.6 15573.7 17896.1 [6,] 13253.9 14381.1 13574.4 13693.1 16805.9 17495.0 18089.3 [7,] 12036.8 12509.9 12802.6 12970.0 13829.4 14155.8 15660.0 [8,] 12653.2 12122.3 11737.3 11392.8 13735.6 14913.9 16162.4 [9,] 14035.4 13122.3 13850.2 13985.2 15870.5 17250.4 17850.1 [10,] 14571.4 13908.7 15081.8 14994.7 15962.4 15879.8 18520.4 [11,] 15400.9 13456.5 13653.3 13584.7 15744.1 17647.8 18524.7 [12,] 14283.2 12441.6 14019.1 14257.8 16083.7 17749.9 16843.7 > 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] 13533.37 13715.38 13555.39 13700.18 15042.84 16205.16 17509.29 > arr.sd [1] 1240.2485 1026.1514 845.9612 924.1735 1240.1625 1262.4651 1283.2176 > arr.range [1] 3846.4 3436.8 3344.5 3601.9 3252.5 3594.1 4620.0 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -47.69879 0.07899 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -3.765 1.123 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 823.2892 0.1930 > postscript(file="/var/www/html/rcomp/tmp/14b7a1228660923.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/2s5iy1228660923.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/3arki1228660923.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/4lqhb1228660923.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/5smp51228660923.tab") > > system("convert tmp/14b7a1228660923.ps tmp/14b7a1228660923.png") > system("convert tmp/2s5iy1228660923.ps tmp/2s5iy1228660923.png") > > > proc.time() user system elapsed 0.526 0.286 0.612