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(103.6,103.5,110.9,115.8,117.8,121.1,128.7,112.7,111.3,116.2,109.8,137.9,98.7,100.5,128.7,98.7,115,121,125.9,117.3,115,113.8,115.7,145.5,101.7,106.9,116.4,114.6,122.5,120.4,116.5,117,114.3,111.5,117.8,141.5,102.6,103.8,119.8,113.6,121.8,123.9,122.7,120,111.6,117.6,121.3,143.7,107.1,107.7,126.4,111.5,127.9,124.9,122,124.9,113.9,120.8,123.3,143.5,107.1,106.5,114.6,122.2,120.2,123.1,127.1,118.5,116.1,120.6,115.7,146.5,108,106.6,122.2,115.8,115.6,124.5,121.7,118.7,113.7,113.4,115.1,143.9,101,103.4,121.5,111.9,117.4,124.3,122,119.7,115,112.2,115.3,142.6,104.1,105.3,124.4,113.9,124.8,131.8,125.6,125,119.7,116.1,120,148.1,109.2,109.4,135.1,114.9,129,138.5,125.6,130.4,120.3,126.2,127.6,150.9,114.6,118.6,131.4,124.5,136.8,136.8,136.6,131,125.8,129.4,124.8,157.1,116.6,114.2,128.4,127.3,133.5,137.2,137.7,131.2,127.7,133.9,124.3,160.6) > 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] 144 > (np <- floor(n / par1)) [1] 36 > 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] [,12] [1,] 103.6 117.8 111.3 98.7 115.0 115.0 101.7 122.5 114.3 102.6 121.8 111.6 [2,] 103.5 121.1 116.2 100.5 121.0 113.8 106.9 120.4 111.5 103.8 123.9 117.6 [3,] 110.9 128.7 109.8 128.7 125.9 115.7 116.4 116.5 117.8 119.8 122.7 121.3 [4,] 115.8 112.7 137.9 98.7 117.3 145.5 114.6 117.0 141.5 113.6 120.0 143.7 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 107.1 127.9 113.9 107.1 120.2 116.1 108.0 115.6 113.7 101.0 117.4 115.0 [2,] 107.7 124.9 120.8 106.5 123.1 120.6 106.6 124.5 113.4 103.4 124.3 112.2 [3,] 126.4 122.0 123.3 114.6 127.1 115.7 122.2 121.7 115.1 121.5 122.0 115.3 [4,] 111.5 124.9 143.5 122.2 118.5 146.5 115.8 118.7 143.9 111.9 119.7 142.6 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [1,] 104.1 124.8 119.7 109.2 129.0 120.3 114.6 136.8 125.8 116.6 133.5 127.7 [2,] 105.3 131.8 116.1 109.4 138.5 126.2 118.6 136.8 129.4 114.2 137.2 133.9 [3,] 124.4 125.6 120.0 135.1 125.6 127.6 131.4 136.6 124.8 128.4 137.7 124.3 [4,] 113.9 125.0 148.1 114.9 130.4 150.9 124.5 131.0 157.1 127.3 131.2 160.6 > 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.450 120.075 118.800 106.650 119.800 122.500 109.900 119.100 121.275 [10] 109.950 122.100 123.550 113.175 124.925 125.375 112.600 122.225 124.725 [19] 113.150 120.125 121.525 109.450 120.850 121.275 111.925 126.800 125.975 [28] 117.150 130.875 131.250 122.275 135.300 134.275 121.625 134.900 136.625 > arr.sd [1] 6.001389 6.708390 13.023312 14.724469 4.758851 15.353393 6.845436 [8] 2.853069 13.727436 8.209547 1.643168 14.015349 9.029350 2.408838 [15] 12.720423 7.385120 3.764195 14.685679 7.265214 3.835253 14.935054 [22] 9.295339 2.969287 14.285045 9.392328 3.350622 14.856059 12.254659 [29] 5.468318 13.476523 7.317274 2.868217 15.344353 7.268368 3.097311 [36] 16.470049 > arr.range [1] 12.3 16.0 28.1 30.0 10.9 31.7 14.7 6.0 30.0 17.2 3.9 32.1 19.3 5.9 29.6 [16] 15.7 8.6 30.8 15.6 8.9 30.5 20.5 6.9 30.4 20.3 7.0 32.0 25.9 12.9 30.6 [31] 16.8 5.8 32.3 14.2 6.5 36.3 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 4.94368 0.03294 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 5.8596 -0.8029 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 6.9754 0.1021 > postscript(file="/var/www/rcomp/tmp/16y1z1291672156.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/26y1z1291672156.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/3rhzm1291672156.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/4u0ga1291672156.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/5gify1291672156.tab") > > try(system("convert tmp/16y1z1291672156.ps tmp/16y1z1291672156.png",intern=TRUE)) character(0) > try(system("convert tmp/26y1z1291672156.ps tmp/26y1z1291672156.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.630 0.260 0.862