R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(5740,5639,5538,5336,7380,7279,5740,4718,4819,4819,4920,5133,4516,3898,3392,3392,5336,5538,3999,2258,3179,3179,3898,4313,4212,3179,3696,3493,5234,4819,3179,1954,3078,3392,3696,4100,3280,2572,2876,2977,5639,5639,4100,3898,4516,4212,5032,6054,6257,4819,4414,3999,6773,6976,6459,6976,6874,6054,6976,7998,8413,7178,6358,6976,9638,10458,10256,10660,10559,9537,11278,11693,12300,10458,9739,10559,12513,14254,13839,13839,14042,13333,15176,15176,14862,13120,13434,13637,14973,16714,15479,16097,15580,15277,17636,17119,16400,15378,16400,16917,17534,18354,17534,18040,17423,17322,19883,20096,19276,17838,19063,19579,20197,21118,20197,20916,20602,19478,21837,21837) > 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] 120 > (np <- floor(n / par1)) [1] 30 > 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] [,14] [1,] 5740 7380 4819 4516 5336 3179 4212 5234 3078 3280 5639 4516 6257 6773 [2,] 5639 7279 4819 3898 5538 3179 3179 4819 3392 2572 5639 4212 4819 6976 [3,] 5538 5740 4920 3392 3999 3898 3696 3179 3696 2876 4100 5032 4414 6459 [4,] 5336 4718 5133 3392 2258 4313 3493 1954 4100 2977 3898 6054 3999 6976 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 6874 8413 9638 10559 12300 12513 14042 14862 14973 15580 16400 17534 [2,] 6054 7178 10458 9537 10458 14254 13333 13120 16714 15277 15378 18354 [3,] 6976 6358 10256 11278 9739 13839 15176 13434 15479 17636 16400 17534 [4,] 7998 6976 10660 11693 10559 13839 15176 13637 16097 17119 16917 18040 [,27] [,28] [,29] [,30] [1,] 17423 19276 20197 20602 [2,] 17322 17838 21118 19478 [3,] 19883 19063 20197 21837 [4,] 20096 19579 20916 21837 > 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] 5563.25 6279.25 4922.75 3799.50 4282.75 3642.25 3645.00 3796.50 [9] 3566.50 2926.25 4819.00 4953.50 4872.25 6796.00 6975.50 7231.25 [17] 10253.00 10766.75 10764.00 13611.25 14431.75 13763.25 15815.75 16403.00 [25] 16273.75 17865.50 18681.00 18939.00 20607.00 20938.50 > arr.sd [1] 172.4903 1283.1527 148.0324 533.9123 1512.7365 561.1045 433.7242 [8] 1515.2585 436.0715 291.9662 950.4388 807.9792 981.9923 244.1980 [15] 796.8628 861.6045 441.9306 944.2388 1087.1342 757.8524 906.8210 [22] 762.7509 754.8913 1151.5424 644.9849 403.6777 1513.9875 763.9254 [29] 480.5559 1134.4451 > arr.range [1] 404 2662 314 1124 3280 1134 1033 3280 1022 708 1741 1842 2258 517 1944 [16] 2055 1022 2156 2561 1741 1843 1742 1741 2359 1539 820 2774 1741 921 2359 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 668.53200 0.01085 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 4.333 0.241 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 1.516e+03 1.734e-02 > postscript(file="/var/wessaorg/rcomp/tmp/1s5po1312388522.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/wessaorg/rcomp/tmp/2pya81312388522.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/31n5x1312388522.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/wessaorg/rcomp/tmp/41uni1312388522.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/wessaorg/rcomp/tmp/5nw1j1312388522.tab") > > try(system("convert tmp/1s5po1312388522.ps tmp/1s5po1312388522.png",intern=TRUE)) character(0) > try(system("convert tmp/2pya81312388522.ps tmp/2pya81312388522.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.643 0.162 0.850