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(192528,190773,188996,185320,221698,219771,192528,174414,176163,176163,178112,181616,192528,188996,194449,203412,254400,254400,243516,232604,241567,252473,254400,259853,276217,265306,265306,281670,327033,330709,321580,299762,316121,316121,317876,327033,334241,337917,337917,348823,390681,401565,403314,376071,390681,385228,374317,397889,403314,394185,396112,408773,456085,479624,479624,468740,485082,468740,459588,494239,499664,486832,519533,532366,570521,595842,592339,590389,604999,603222,581432,614128,625040,614128,659491,681309,732102,752143,746712,735800,744935,755841,719441,748461,766753,759373,806657,822993,892101,904761,888424,897554,903007,908460,873809,906511,924624,906511,959275,975618,1046468,1057380,1060884,1079170,1079170,1086378,1053676,1070041,1080925,1060884,1119079,1129986,1202597,1215430,1233543,1249908,1251657,1253584,1220883,1253584) > 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] [1,] 192528 221698 176163 192528 254400 241567 276217 327033 316121 334241 [2,] 190773 219771 176163 188996 254400 252473 265306 330709 316121 337917 [3,] 188996 192528 178112 194449 243516 254400 265306 321580 317876 337917 [4,] 185320 174414 181616 203412 232604 259853 281670 299762 327033 348823 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 390681 390681 403314 456085 485082 499664 570521 604999 625040 732102 [2,] 401565 385228 394185 479624 468740 486832 595842 603222 614128 752143 [3,] 403314 374317 396112 479624 459588 519533 592339 581432 659491 746712 [4,] 376071 397889 408773 468740 494239 532366 590389 614128 681309 735800 [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [1,] 744935 766753 892101 903007 924624 1046468 1079170 1080925 1202597 1251657 [2,] 755841 759373 904761 908460 906511 1057380 1086378 1060884 1215430 1253584 [3,] 719441 806657 888424 873809 959275 1060884 1053676 1119079 1233543 1220883 [4,] 748461 822993 897554 906511 975618 1079170 1070041 1129986 1249908 1253584 > 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] 189404.2 202102.8 178013.5 194846.2 246230.0 252073.2 272124.8 [8] 319771.0 319287.8 339724.5 392907.8 387028.8 400596.0 471018.2 [15] 476912.2 509598.8 587272.8 600945.2 644992.0 741689.2 742169.5 [22] 788944.0 895710.0 897946.8 941507.0 1060975.5 1072316.2 1097718.5 [29] 1225369.5 1244927.0 > arr.sd [1] 3081.074 22763.154 2571.407 6140.836 10432.824 7669.841 8182.278 [8] 13856.515 5229.358 6308.343 12538.907 9935.043 6719.574 11199.855 [15] 15640.507 20281.857 11393.435 13858.431 30982.868 9329.300 15819.035 [22] 30767.782 7104.731 16249.225 31564.843 13594.648 14110.781 32332.979 [29] 20706.879 16055.053 > arr.range [1] 7208 47284 5453 14416 21796 18286 16364 30947 10912 14582 27243 23572 [13] 14588 23539 34651 45534 25321 32696 67181 20041 36400 63620 16337 34651 [25] 69107 32702 32702 69102 47311 32701 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 6313.3979 0.0134 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 0.6601 0.6649 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 1.377e+04 2.956e-02 > postscript(file="/var/wessaorg/rcomp/tmp/1zs0e1312383200.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/2mxfl1312383200.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/39xtj1312383200.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/44l541312383200.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/5g0cm1312383200.tab") > > try(system("convert tmp/1zs0e1312383200.ps tmp/1zs0e1312383200.png",intern=TRUE)) character(0) > try(system("convert tmp/2mxfl1312383200.ps tmp/2mxfl1312383200.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.642 0.125 0.758