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(7.4271,7.7662,7.6289,7.5281,7.3831,7.2355,7.0617,7.1237,7.4533,7.5411,7.4978,7.3525,7.3862,7.311,7.2013,7.249,7.3321,7.59,7.9082,8.2123,8.0929,8.118,8.1206,8.2883,8.4281,8.7917,8.9168,8.9446,8.9786,9.5862,9.6533,9.4125,9.2195,9.2882,9.6774,9.6857,10.1688,10.4399,10.4675,10.149,9.9163,9.9268,10.0529,10.1622,10.083,10.1134,10.3423,10.7536,11.0967,10.8588,10.7719,10.9262,10.708,10.5062,10.0683,9.8954,9.9589,9.9177,9.7189,9.5273,9.5746,9.763,9.6117,9.6581,9.8361,10.2353,10.1285,10.1347,10.2141,10.0971,9.9651,10.1286,10.3356,10.1238,10.1326,10.2467,10.44,10.3689,10.2415,10.3899,10.3162,10.4533,10.6741,10.8957,10.7404,10.6568,10.5682,10.9833,11.0237,10.8462,10.7287,10.7809,10.2609,9.8252,9.1071,8.695,9.2205,9.0496,8.7406,8.921,9.011,9.3157,9.5786,9.6246,9.7485,9.9431,10.1152,10.1827,9.9777,9.7436,9.3462,9.2623,9.1505,8.5794,8.3245,8.6538,8.752,8.8104,9.2665,9.0895) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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,] 7.4271 7.3862 8.4281 10.1688 11.0967 9.5746 10.3356 10.7404 9.2205 [2,] 7.7662 7.3110 8.7917 10.4399 10.8588 9.7630 10.1238 10.6568 9.0496 [3,] 7.6289 7.2013 8.9168 10.4675 10.7719 9.6117 10.1326 10.5682 8.7406 [4,] 7.5281 7.2490 8.9446 10.1490 10.9262 9.6581 10.2467 10.9833 8.9210 [5,] 7.3831 7.3321 8.9786 9.9163 10.7080 9.8361 10.4400 11.0237 9.0110 [6,] 7.2355 7.5900 9.5862 9.9268 10.5062 10.2353 10.3689 10.8462 9.3157 [7,] 7.0617 7.9082 9.6533 10.0529 10.0683 10.1285 10.2415 10.7287 9.5786 [8,] 7.1237 8.2123 9.4125 10.1622 9.8954 10.1347 10.3899 10.7809 9.6246 [9,] 7.4533 8.0929 9.2195 10.0830 9.9589 10.2141 10.3162 10.2609 9.7485 [10,] 7.5411 8.1180 9.2882 10.1134 9.9177 10.0971 10.4533 9.8252 9.9431 [11,] 7.4978 8.1206 9.6774 10.3423 9.7189 9.9651 10.6741 9.1071 10.1152 [12,] 7.3525 8.2883 9.6857 10.7536 9.5273 10.1286 10.8957 8.6950 10.1827 [,10] [1,] 9.9777 [2,] 9.7436 [3,] 9.3462 [4,] 9.2623 [5,] 9.1505 [6,] 8.5794 [7,] 8.3245 [8,] 8.6538 [9,] 8.7520 [10,] 8.8104 [11,] 9.2665 [12,] 9.0895 > 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] 7.416583 7.734158 9.215217 10.214642 10.329525 9.945575 10.384858 [8] 10.351367 9.454258 9.079700 > arr.sd [1] 0.2029436 0.4256799 0.4074278 0.2442451 0.5372453 0.2447950 0.2197499 [8] 0.7562798 0.4829110 0.4836850 > arr.range [1] 0.7045 1.0870 1.2576 0.8373 1.5694 0.6607 0.7719 2.3287 1.4421 1.6532 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 0.04195 0.03809 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -2.6611 0.7415 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -0.04515 0.13560 > postscript(file="/var/www/html/rcomp/tmp/14zh41293376150.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/2f8yp1293376150.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/3i9wv1293376150.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/439dj1293376150.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/5pabp1293376150.tab") > > try(system("convert tmp/14zh41293376150.ps tmp/14zh41293376150.png",intern=TRUE)) character(0) > try(system("convert tmp/2f8yp1293376150.ps tmp/2f8yp1293376150.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.495 0.275 1.248