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(57.7,63.6,78,77.4,74.1,85.9,82,78.4,68.1,70.9,85.2,149.6,57.9,63.7,85,66.1,80.2,83.4,85.7,81.8,69.4,76.4,90.3,157.3,65.3,68.4,72.7,86.6,82.6,84.8,93.4,82.2,75.2,83.9,85.4,166.3,70.4,73.9,82.4,92.3,82.7,95.8,105.8,84.2,82.7,88.4,90.2,176.6,69.5,77.3,98.6,86.4,90.8,101.5,112.2,93.6,93.8,90.8,98.1,187.6,75,83.7,99.7,104.9,98.9,117.3,115.7,102.2,101.9,96.6,110,203.7,82.3,93.3,121.9,100.9,107.7,130,123.2,116.1,105.3,107.7,123.9,205.2,90.3,106.9,122.4,111.3,122.6,124.8,139.5,118.8,111,121.2,120.6,219.1,101.3,105,113.4,133.6,123.9,136.2,151.7,121.9,120.2,132.2,125.2,233.8) > 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] 108 > (np <- floor(n / par1)) [1] 27 > 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] [,13] [1,] 57.7 74.1 68.1 57.9 80.2 69.4 65.3 82.6 75.2 70.4 82.7 82.7 69.5 [2,] 63.6 85.9 70.9 63.7 83.4 76.4 68.4 84.8 83.9 73.9 95.8 88.4 77.3 [3,] 78.0 82.0 85.2 85.0 85.7 90.3 72.7 93.4 85.4 82.4 105.8 90.2 98.6 [4,] 77.4 78.4 149.6 66.1 81.8 157.3 86.6 82.2 166.3 92.3 84.2 176.6 86.4 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 90.8 93.8 75.0 98.9 101.9 82.3 107.7 105.3 90.3 122.6 111.0 101.3 [2,] 101.5 90.8 83.7 117.3 96.6 93.3 130.0 107.7 106.9 124.8 121.2 105.0 [3,] 112.2 98.1 99.7 115.7 110.0 121.9 123.2 123.9 122.4 139.5 120.6 113.4 [4,] 93.6 187.6 104.9 102.2 203.7 100.9 116.1 205.2 111.3 118.8 219.1 133.6 [,26] [,27] [1,] 123.9 120.2 [2,] 136.2 132.2 [3,] 151.7 125.2 [4,] 121.9 233.8 > 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] 69.175 80.100 93.450 68.175 82.775 98.350 73.250 85.750 102.700 [10] 79.750 92.125 109.475 82.950 99.525 117.575 90.825 108.525 128.050 [19] 99.600 119.250 135.525 107.725 126.425 142.975 113.325 133.425 152.850 > arr.sd [1] 10.137184 5.037857 38.175079 11.732966 2.347161 40.248437 9.403014 [8] 5.226535 42.637777 9.766780 10.834320 44.864045 12.511994 9.587970 [15] 46.779367 13.881252 9.329657 50.733454 16.712869 9.565389 47.178835 [22] 13.322256 9.062147 50.964718 14.433612 13.726222 54.190620 > arr.range [1] 20.3 11.8 81.5 27.1 5.5 87.9 21.3 11.2 91.1 21.9 23.1 93.9 [13] 29.1 21.4 96.8 29.9 18.4 107.1 39.6 22.3 99.9 32.1 20.7 108.1 [25] 32.3 29.8 113.6 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -27.2624 0.4791 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -7.535 2.235 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -55.1469 0.9975 > postscript(file="/var/www/html/rcomp/tmp/13bsw1291465893.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/23bsw1291465893.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/3pb821291465893.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/4su7p1291465893.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/5wvow1291465893.tab") > > try(system("convert tmp/13bsw1291465893.ps tmp/13bsw1291465893.png",intern=TRUE)) character(0) > try(system("convert tmp/23bsw1291465893.ps tmp/23bsw1291465893.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.528 0.313 1.233