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(492865,480961,461935,456608,441977,439148,488180,520564,501492,485025,464196,460170,467037,460070,447988,442867,436087,431328,484015,509673,512927,502831,470984,471067,476049,474605,470439,461251,454724,455626,516847,525192,522975,518585,509239,512238,519164,517009,509933,509127,500857,506971,569323,579714,577992,565464,547344,554788,562325,560854,555332,543599,536662,542722,593530,610763,612613,611324,594167,595454,590865,589379,584428,573100,567456,569028,620735,628884,628232,612117,595404,597141,593408,590072,579799,574205,572775,572942,619567,625809,619916,587625,565742,557274,560576,548854,531673,525919,511038,498662,555362,564591,541657,527070,509846,514258,516922,507561,492622,490243,469357,477580,528379,533590,517945,506174,501866,516141,528222,532638,536322,536535,523597,536214,586570,596594,580523) > 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] 117 > (np <- floor(n / par1)) [1] 29 > 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,] 492865 441977 501492 467037 436087 512927 476049 454724 522975 519164 [2,] 480961 439148 485025 460070 431328 502831 474605 455626 518585 517009 [3,] 461935 488180 464196 447988 484015 470984 470439 516847 509239 509933 [4,] 456608 520564 460170 442867 509673 471067 461251 525192 512238 509127 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 500857 577992 562325 536662 612613 590865 567456 628232 593408 572775 [2,] 506971 565464 560854 542722 611324 589379 569028 612117 590072 572942 [3,] 569323 547344 555332 593530 594167 584428 620735 595404 579799 619567 [4,] 579714 554788 543599 610763 595454 573100 628884 597141 574205 625809 [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [1,] 619916 560576 511038 541657 516922 469357 517945 528222 523597 [2,] 587625 548854 498662 527070 507561 477580 506174 532638 536214 [3,] 565742 531673 555362 509846 492622 528379 501866 536322 586570 [4,] 557274 525919 564591 514258 490243 533590 516141 536535 596594 > 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] 473092.2 472467.2 477720.8 454490.5 465275.8 489452.2 470586.0 488097.2 [9] 515759.2 513808.2 539216.2 561397.0 555527.5 570919.2 603389.5 584443.0 [17] 596525.8 608223.5 584371.0 597773.2 582639.2 541755.5 532413.2 523207.8 [25] 501837.0 502226.5 510531.5 533429.2 560743.8 > arr.sd [1] 16823.531 39157.867 19229.943 11044.361 37976.783 21672.936 6662.346 [8] 38169.466 6190.444 5028.602 41059.600 13330.419 8503.038 36821.255 [15] 9934.048 8047.154 32834.538 15304.256 8914.773 28881.795 27948.326 [22] 15885.543 32445.343 14305.316 12644.610 33443.865 7756.829 3905.347 [29] 36211.533 > arr.range [1] 36257 81416 41322 24170 78345 41943 14798 70468 13736 10037 78857 30648 [13] 18726 74101 18446 17765 61428 32828 19203 53034 62642 34657 65929 31811 [25] 26679 64233 16079 8313 72997 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 2.505e+04 -8.853e-03 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 10.65625 -0.07243 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 5.440e+04 -2.444e-02 > postscript(file="/var/www/html/rcomp/tmp/1os8x1262774180.ps",horizontal=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/2hm1a1262774180.ps",horizontal=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/3gzbl1262774180.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/4poen1262774180.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/5hzck1262774180.tab") > > try(system("convert tmp/1os8x1262774180.ps tmp/1os8x1262774180.png",intern=TRUE)) character(0) > try(system("convert tmp/2hm1a1262774180.ps tmp/2hm1a1262774180.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.521 0.304 1.004