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(621.0,604.0,584.0,574.0,555.0,545.0,599.0,620.0,608.0,590.0,579.0,580.0,579.0,572.0,560.0,551.0,537.0,541.0,588.0,607.0,599.0,578.0,563.0,566.0,561.0,554.0,540.0,526.0,512.0,505.0,554.0,584.0,569.0,540.0,522.0,526.0,527.0,516.0,503.0,489.0,479.0,475.0,524.0,552.0,532.0,511.0,492.0,492.0,493.0,481.0,462.0,457.0,442.0,439.0,488.0,521.0,501.0,485.0,464.0,460.0,467.0,460.0,448.0,443.0,436.0,431.0,484.0,510.0,513.0,503.0,471.0,471.0,476.0,475.0,470.0,461.0,455.0,456.0,517.0,525.0,523.0,519.0,509.0,512.0,519.0,517.0,510.0,509.0,501.0,507.0,569.0,580.0,578.0,565.0,547.0,555.0,562.0,561.0,555.0,544.0,537.0,543.0,594.0,611.0,613.0,611.0,594.0,595.0,591.0,589.0,584.0,573.0,567.0,569.0,621.0,629.0,628.0,612.0,595.0,597.0,593.0,590.0,580.0,574.0,573.0,573.0,620.0,626.0,620.0,588.0,566.0,557.0,561.0,549.0,532.0,526.0,511.0,499.0,555.0,565.0,542.0,527.0,510.0,514.0,517.0,508.0,493.0,490.0,469.0,478.0,528.0,534.0,518.0,506.0,502.0) > par1 = '12' > #'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] 155 > (np <- floor(n / par1)) [1] 12 > 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,] 621 579 561 527 493 467 476 519 562 591 593 561 [2,] 604 572 554 516 481 460 475 517 561 589 590 549 [3,] 584 560 540 503 462 448 470 510 555 584 580 532 [4,] 574 551 526 489 457 443 461 509 544 573 574 526 [5,] 555 537 512 479 442 436 455 501 537 567 573 511 [6,] 545 541 505 475 439 431 456 507 543 569 573 499 [7,] 599 588 554 524 488 484 517 569 594 621 620 555 [8,] 620 607 584 552 521 510 525 580 611 629 626 565 [9,] 608 599 569 532 501 513 523 578 613 628 620 542 [10,] 590 578 540 511 485 503 519 565 611 612 588 527 [11,] 579 563 522 492 464 471 509 547 594 595 566 510 [12,] 580 566 526 492 460 471 512 555 595 597 557 514 > 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] 588.2500 570.0833 541.0833 507.6667 474.4167 469.7500 491.5000 538.0833 [9] 576.6667 596.2500 588.3333 532.5833 > arr.sd [1] 23.71852 21.61421 23.97142 23.41069 24.57071 28.17841 28.19574 30.42265 [9] 29.10587 21.97571 22.71297 21.83183 > arr.range [1] 76 70 79 77 82 82 70 79 76 62 69 66 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 38.7358 -0.0255 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 6.6749 -0.5509 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 116.69379 -0.07913 > postscript(file="/var/www/html/rcomp/tmp/1vbw81261241765.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/2xyh71261241765.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/31lxy1261241765.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/4ll6m1261241765.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/592r01261241765.tab") > > try(system("convert tmp/1vbw81261241765.ps tmp/1vbw81261241765.png",intern=TRUE)) character(0) > try(system("convert tmp/2xyh71261241765.ps tmp/2xyh71261241765.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.508 0.294 0.964