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(21571,21493,21422,21272,22747,22676,21571,20831,20909,20909,20980,21130,21051,21643,21864,21643,22455,21935,20759,20467,20467,20610,20026,20467,20097,20467,21051,21272,21792,21571,20246,19726,19506,19726,19363,19506,19064,19805,20168,20246,21643,21643,19805,19363,19363,19584,18622,18180,17668,17817,18480,17960,19363,19584,18180,17668,17375,17668,16855,16563,15388,15680,15751,15830,17226,17076,15388,14647,14355,14725,13322,12367,10601,10750,10750,10601,11854,11926,10451,10159,9568,10380,8905,8022,6333,6697,6255,6404,7509,7730,6996,6917,6917,7879,6184,5079,3163,4709,4488,4566,6333,6112,5300,5671,5671,6996,5450,4566,3163,5008,4859,4930,6476,6333,5813,5892,6255,7067,5813,4787) > 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] [1,] 21571 22747 20909 21051 22455 20467 20097 21792 19506 19064 21643 19363 [2,] 21493 22676 20909 21643 21935 20610 20467 21571 19726 19805 21643 19584 [3,] 21422 21571 20980 21864 20759 20026 21051 20246 19363 20168 19805 18622 [4,] 21272 20831 21130 21643 20467 20467 21272 19726 19506 20246 19363 18180 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 17668 19363 17375 15388 17226 14355 10601 11854 9568 6333 7509 6917 [2,] 17817 19584 17668 15680 17076 14725 10750 11926 10380 6697 7730 7879 [3,] 18480 18180 16855 15751 15388 13322 10750 10451 8905 6255 6996 6184 [4,] 17960 17668 16563 15830 14647 12367 10601 10159 8022 6404 6917 5079 [,25] [,26] [,27] [,28] [,29] [,30] [1,] 3163 6333 5671 3163 6476 6255 [2,] 4709 6112 6996 5008 6333 7067 [3,] 4488 5300 5450 4859 5813 5813 [4,] 4566 5671 4566 4930 5892 4787 > 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] 21439.50 21956.25 20982.00 21550.25 21404.00 20392.50 20721.75 20833.75 [9] 19525.25 19820.75 20613.50 18937.25 17981.25 18698.75 17115.25 15662.25 [17] 16084.25 13692.25 10675.50 11097.50 9218.75 6422.25 7288.00 6514.75 [25] 4231.50 5854.00 5670.75 4490.00 6128.50 5980.50 > arr.sd [1] 127.17049 923.38702 104.18893 348.75720 945.26116 253.46203 [7] 537.39828 1005.70717 149.85187 539.85762 1202.38139 651.24464 [13] 353.22644 923.11840 498.56887 192.82527 1269.85731 1064.45334 [19] 86.02519 923.30006 1000.18777 193.01015 394.59262 1182.33621 [25] 718.18777 460.58296 1004.23947 886.75701 325.60149 950.14578 > arr.range [1] 299 1916 221 813 1988 584 1175 2066 363 1182 2280 1404 812 1916 1105 [16] 442 2579 2358 149 1767 2358 442 813 2800 1546 1033 2430 1845 663 2280 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 752.078488 -0.007765 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 8.425 -0.234 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 1724.05151 -0.02342 > postscript(file="/var/wessaorg/rcomp/tmp/1u7881313497197.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/262gb1313497197.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/3a2kb1313497197.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/4d35a1313497197.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/54gu31313497197.tab") > > try(system("convert tmp/1u7881313497197.ps tmp/1u7881313497197.png",intern=TRUE)) character(0) > try(system("convert tmp/262gb1313497197.ps tmp/262gb1313497197.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.632 0.136 0.761