R version 2.6.2 (2008-02-08) Copyright (C) 2008 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(516.922,514.258,509.846,527.070,541.657,564.591,555.362,498.662,511.038,525.919,531.673,548.854,560.576,557.274,565.742,587.625,619.916,625.809,619.567,572.942,572.775,574.205,579.799,590.072,593.408,597.141,595.404,612.117,628.232,628.884,620.735,569.028,567.456,573.100,584.428,589.379,590.865,595.454,594.167,611.324,612.613,610.763,593.530,542.722,536.662,543.599,555.332,560.854,562.325,554.788,547.344,565.464,577.992,579.714,569.323,506.971,500.857,509.127,509.933,517.009,519.164,512.238,509.239,518.585,522.975,525.192,516.847,455.626,454.724,461.251,470.439,474.605,476.049,471.067,470.984,502.831,512.927,509.673,484.015,431.328,436.087,442.867,447.988,460.070,467.037,460.170,464.196,485.025,501.492,520.564,488.180,439.148,441.977,456.608,461.935,480.961,492.865) > 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] 97 > (np <- floor(n / par1)) [1] 24 > 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,] 516.922 541.657 511.038 560.576 619.916 572.775 593.408 628.232 567.456 [2,] 514.258 564.591 525.919 557.274 625.809 574.205 597.141 628.884 573.100 [3,] 509.846 555.362 531.673 565.742 619.567 579.799 595.404 620.735 584.428 [4,] 527.070 498.662 548.854 587.625 572.942 590.072 612.117 569.028 589.379 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 590.865 612.613 536.662 562.325 577.992 500.857 519.164 522.975 454.724 [2,] 595.454 610.763 543.599 554.788 579.714 509.127 512.238 525.192 461.251 [3,] 594.167 593.530 555.332 547.344 569.323 509.933 509.239 516.847 470.439 [4,] 611.324 542.722 560.854 565.464 506.971 517.009 518.585 455.626 474.605 [,19] [,20] [,21] [,22] [,23] [,24] [1,] 476.049 512.927 436.087 467.037 501.492 441.977 [2,] 471.067 509.673 442.867 460.170 520.564 456.608 [3,] 470.984 484.015 447.988 464.196 488.180 461.935 [4,] 502.831 431.328 460.070 485.025 439.148 480.961 > 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] 517.0240 540.0680 529.3710 567.8043 609.5585 579.2128 599.5175 611.7197 [9] 578.5908 597.9525 589.9070 549.1118 557.4803 558.5000 509.2315 514.8065 [17] 505.1600 465.2548 480.2328 484.4857 446.7530 469.1070 487.3460 460.3702 > arr.sd [1] 7.305408 29.167709 15.630117 13.665635 24.578410 7.848337 8.537018 [8] 28.700326 10.076223 9.121443 32.609229 10.984210 8.107684 34.652306 [15] 6.611222 4.860011 33.210733 8.967169 15.250519 37.723866 10.128051 [22] 10.979610 34.772056 16.113075 > arr.range [1] 17.224 65.929 37.816 30.351 52.867 17.297 18.709 59.856 21.923 20.459 [11] 69.891 24.192 18.120 72.743 16.152 9.925 69.566 19.881 31.847 81.599 [21] 23.983 24.855 81.416 38.984 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 11.30446 0.01158 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 0.2215 0.3902 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 33.564623 0.009371 > postscript(file="/var/www/html/rcomp/tmp/1lafm1210412507.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/2v3hz1210412507.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/3d8u21210412507.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/45bwa1210412507.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/5p9hg1210412507.tab") > > system("convert tmp/1lafm1210412507.ps tmp/1lafm1210412507.png") > system("convert tmp/2v3hz1210412507.ps tmp/2v3hz1210412507.png") > > > proc.time() user system elapsed 0.770 0.292 0.909