R version 2.7.0 (2008-04-22) 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(284.4,212.8,226.9,308.4,262,227.9,236.1,320.4,271.9,232.8,237,313.4,261.4,226.8,249.9,314.3,286.1,226.5,260.4,311.4,294.7,232.6,257.2,339.2,279.1,249.8,269.8,345.7,293.8,254.7,277.5,363.4,313.4,272.8,300.1,369.5,330.8,287.8,305.9,386.1,335.2,288,308.3,402.3,352.8,316.1,324.9,404.8,393,318.9,327,442.3,383.1,331.6,361.4,445.9,386.6,357.2,373.6,466.2,409.6,369.8,378.6,487,419.2,376.7,392.8,506.1,458.4,387.4,426.9,565,464.8,444.5,449.5,556.1,499.6,451.9,434.9,553.8,510,432.9,453.2,547.6,485.8,452.6,456.6,565.7,514.8,464.3,430.9,588.3,503.1,442.6,448,554.5,504.5,427.3,473.1,526.2,547.5,440.2,468.7,574.5,492.6,432.6,479.8,575.7,474.6,405.3,434.6,535.1,452.6,429.5,417.2,551.8,464,416.6,422.9,553.6,458.6,427.6,429.2,534.2,481.7,416,440.2,538.7,473.8,439.9,446.8,597.5,467.2,439.4,447.4,568.5,485.9,442.1,430.5,600,464.5,423.6,437,574,443,410,420,532,432,420,411,512) > 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] 152 > (np <- floor(n / par1)) [1] 38 > 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,] 284.4 262.0 271.9 261.4 286.1 294.7 279.1 293.8 313.4 330.8 335.2 352.8 [2,] 212.8 227.9 232.8 226.8 226.5 232.6 249.8 254.7 272.8 287.8 288.0 316.1 [3,] 226.9 236.1 237.0 249.9 260.4 257.2 269.8 277.5 300.1 305.9 308.3 324.9 [4,] 308.4 320.4 313.4 314.3 311.4 339.2 345.7 363.4 369.5 386.1 402.3 404.8 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 393.0 383.1 386.6 409.6 419.2 458.4 464.8 499.6 510.0 485.8 514.8 503.1 [2,] 318.9 331.6 357.2 369.8 376.7 387.4 444.5 451.9 432.9 452.6 464.3 442.6 [3,] 327.0 361.4 373.6 378.6 392.8 426.9 449.5 434.9 453.2 456.6 430.9 448.0 [4,] 442.3 445.9 466.2 487.0 506.1 565.0 556.1 553.8 547.6 565.7 588.3 554.5 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [1,] 504.5 547.5 492.6 474.6 452.6 464.0 458.6 481.7 473.8 467.2 485.9 464.5 [2,] 427.3 440.2 432.6 405.3 429.5 416.6 427.6 416.0 439.9 439.4 442.1 423.6 [3,] 473.1 468.7 479.8 434.6 417.2 422.9 429.2 440.2 446.8 447.4 430.5 437.0 [4,] 526.2 574.5 575.7 535.1 551.8 553.6 534.2 538.7 597.5 568.5 600.0 574.0 [,37] [,38] [1,] 443 432 [2,] 410 420 [3,] 420 411 [4,] 532 512 > 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] 258.125 261.600 263.775 263.100 271.100 280.925 286.100 297.350 313.950 [10] 327.650 333.450 349.650 370.300 380.500 395.900 411.250 423.700 459.425 [19] 478.725 485.050 485.925 490.175 499.575 487.050 482.775 507.725 495.175 [28] 462.400 462.775 464.275 462.400 469.150 489.500 480.625 489.625 474.775 [37] 451.250 443.750 > arr.sd [1] 45.63371 41.80726 37.43887 37.04169 36.29848 46.48981 41.57138 46.86239 [9] 40.70729 42.76841 49.80499 39.95668 58.35563 48.44220 48.38581 53.30700 [17] 57.65940 76.14155 52.30120 53.39229 52.49123 52.47961 68.47021 52.62385 [25] 42.92935 63.57024 59.56209 56.17645 61.13724 63.15016 49.94317 53.72067 [33] 73.47095 59.73733 77.35396 68.30570 55.57802 46.30605 > arr.range [1] 95.6 92.5 80.6 87.5 84.9 106.6 95.9 108.7 96.7 98.3 114.3 88.7 [13] 123.4 114.3 109.0 117.2 129.4 177.6 111.6 118.9 114.7 113.1 157.4 111.9 [25] 98.9 134.3 143.1 129.8 134.6 137.0 106.6 122.7 157.6 129.1 169.5 150.4 [37] 122.0 101.0 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 16.62034 0.08896 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 0.1060 0.6420 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 42.2118 0.1858 > postscript(file="/var/www/html/rcomp/tmp/1iqco1233074381.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/2mh711233074381.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/3r1wy1233074381.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/4jn4s1233074381.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/5kaex1233074381.tab") > > system("convert tmp/1iqco1233074381.ps tmp/1iqco1233074381.png") > system("convert tmp/2mh711233074381.ps tmp/2mh711233074381.png") > > > proc.time() user system elapsed 1.394 0.453 1.489