R version 2.8.0 (2008-10-20) 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(451,450,444,429,421,400,389,384,432,446,431,423,416,416,413,399,386,374,365,365,418,428,424,421,417,423,423,419,406,398,390,391,444,460,455,456,452,459,461,451,443,439,430,436,488,506,502,501,501,515,521,520,512,509,505,511,570,592,594,586,586,592,594,586,572,563,555,554,601,622,617,606,595,599,600,592,575,567,555,555,608,631,629,624,610,616,621,604,584,574,555,545,599,620,608,590,579,580,579,572,560,551,537,541,588,607,599,578,563,566,561,554,540,526,512,505,554,584,569,540,522,526,527,516,503,489,479,475,524,552,532,511,492,492,493,481,462,457,442,439,488,521,501,485,464,460,467,460,448,443,436,431,484,510,513,503,471,471,476,475,470,461,455,456,517,525,523,519,509,512,519,517,510,509,501,507,569,580,578,565,547,555,562,561,555,544,537,543,594,611,613,611,594,595,591,589,584,573,567,569,621,629,628,612,595,597,593,590,580,574,573,573,620,626,620,588,566,557,561,549,532,526,511,499,555,565,542,527,510,514,517,508,493,490,469,478,528,534,518,506,502) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = '' > par3 = '' > par2 = '' > par1 = '12' > ylab = '' > xlab = '' > main = '' > #'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] 241 > (np <- floor(n / par1)) [1] 20 > 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] [,13] [1,] 451 416 417 452 501 586 595 610 579 563 522 492 464 [2,] 450 416 423 459 515 592 599 616 580 566 526 492 460 [3,] 444 413 423 461 521 594 600 621 579 561 527 493 467 [4,] 429 399 419 451 520 586 592 604 572 554 516 481 460 [5,] 421 386 406 443 512 572 575 584 560 540 503 462 448 [6,] 400 374 398 439 509 563 567 574 551 526 489 457 443 [7,] 389 365 390 430 505 555 555 555 537 512 479 442 436 [8,] 384 365 391 436 511 554 555 545 541 505 475 439 431 [9,] 432 418 444 488 570 601 608 599 588 554 524 488 484 [10,] 446 428 460 506 592 622 631 620 607 584 552 521 510 [11,] 431 424 455 502 594 617 629 608 599 569 532 501 513 [12,] 423 421 456 501 586 606 624 590 578 540 511 485 503 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 471 509 547 594 595 566 510 [2,] 471 512 555 595 597 557 514 [3,] 476 519 562 591 593 561 517 [4,] 475 517 561 589 590 549 508 [5,] 470 510 555 584 580 532 493 [6,] 461 509 544 573 574 526 490 [7,] 455 501 537 567 573 511 469 [8,] 456 507 543 569 573 499 478 [9,] 517 569 594 621 620 555 528 [10,] 525 580 611 629 626 565 534 [11,] 523 578 613 628 620 542 518 [12,] 519 565 611 612 588 527 506 > 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] 425.0000 402.0833 423.5000 464.0000 536.3333 587.3333 594.1667 593.8333 [9] 572.5833 547.8333 513.0000 479.4167 468.2500 484.9167 531.3333 569.4167 [17] 596.0000 594.0833 540.8333 505.4167 > arr.sd [1] 23.01383 23.50419 25.22445 27.80778 37.16385 22.70496 26.77799 25.05207 [9] 21.68979 23.90068 22.83936 24.57441 28.33605 27.53331 31.32624 29.23403 [17] 21.98346 18.87017 21.91651 19.51903 > arr.range [1] 67 63 70 76 93 68 76 76 70 79 77 82 82 70 79 76 62 53 67 65 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 28.351303 -0.006142 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 4.0467 -0.1336 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 76.293726 -0.007179 > postscript(file="/var/www/html/freestat/rcomp/tmp/1s60n1229960564.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/freestat/rcomp/tmp/2z9x51229960564.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3g2kp1229960564.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/freestat/rcomp/tmp/4jyuy1229960564.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/freestat/rcomp/tmp/5spvr1229960564.tab") > > system("convert tmp/1s60n1229960564.ps tmp/1s60n1229960564.png") > system("convert tmp/2z9x51229960564.ps tmp/2z9x51229960564.png") > > > proc.time() user system elapsed 0.752 0.417 0.836