R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(396 + ,297 + ,559 + ,967 + ,270 + ,143 + ,1562 + ,109 + ,371 + ,656 + ,511 + ,655 + ,465 + ,525 + ,885 + ,497 + ,1436 + ,612 + ,865 + ,385 + ,567 + ,639 + ,963 + ,398 + ,410 + ,966 + ,801 + ,892 + ,513 + ,469 + ,683 + ,643 + ,535 + ,625 + ,264 + ,992 + ,238 + ,818 + ,937 + ,70 + ,507 + ,260 + ,503 + ,927 + ,1269 + ,537 + ,910 + ,532 + ,345 + ,918 + ,1635 + ,330 + ,557 + ,1178 + ,740 + ,452 + ,218 + ,764 + ,255 + ,454 + ,866 + ,574 + ,1276 + ,379 + ,825 + ,798 + ,663 + ,1069 + ,921 + ,858 + ,711 + ,503 + ,382 + ,464 + ,717 + ,690 + ,462 + ,657 + ,385 + ,577 + ,619 + ,479 + ,817 + ,752 + ,430 + ,451 + ,537 + ,519 + ,1000 + ,637 + ,465 + ,437 + ,711 + ,299 + ,248 + ,1162 + ,714 + ,905 + ,649 + ,512 + ,472 + ,905 + ,786 + ,489 + ,479 + ,617 + ,925 + ,351 + ,1144 + ,669 + ,707 + ,458 + ,214 + ,599 + ,572 + ,897 + ,819 + ,720 + ,273 + ,508 + ,506 + ,451 + ,699 + ,407 + ,465 + ,245 + ,370 + ,316 + ,603 + ,154 + ,229 + ,577 + ,192 + ,617 + ,411 + ,975 + ,146 + ,705 + ,184 + ,200 + ,274 + ,502 + ,382 + ,964 + ,537 + ,438 + ,369 + ,417 + ,276 + ,514 + ,822 + ,389 + ,466 + ,1255 + ,694 + ,1024 + ,400 + ,397 + ,350 + ,719 + ,1277 + ,356 + ,457 + ,1402 + ,600 + ,480 + ,595 + ,436 + ,230 + ,651 + ,1367 + ,564 + ,716 + ,747 + ,467 + ,671 + ,861 + ,319 + ,612 + ,433 + ,434 + ,503 + ,85 + ,564 + ,824 + ,74 + ,259 + ,69 + ,535 + ,239 + ,438 + ,459 + ,426 + ,288 + ,498 + ,454 + ,376 + ,225 + ,555 + ,252 + ,208 + ,130 + ,481 + ,389 + ,565 + ,173 + ,278 + ,609 + ,422 + ,445 + ,387 + ,339 + ,181 + ,245 + ,384 + ,212 + ,399 + ,229 + ,224 + ,203 + ,333 + ,384 + ,636 + ,185 + ,93 + ,581 + ,248 + ,304 + ,344 + ,407 + ,170 + ,312 + ,507 + ,224 + ,340 + ,168 + ,443 + ,204 + ,367 + ,210 + ,335 + ,364 + ,178 + ,206 + ,279 + ,387 + ,490 + ,238 + ,343 + ,232 + ,530 + ,291 + ,67 + ,397 + ,467 + ,178 + ,175 + ,299 + ,154 + ,106 + ,189 + ,194 + ,135 + ,201 + ,207 + ,280 + ,260 + ,227 + ,239 + ,333 + ,428 + ,230 + ,292 + ,350 + ,186 + ,326 + ,155 + ,75 + ,361 + ,261 + ,299 + ,300 + ,450 + ,183 + ,238 + ,165 + ,234 + ,176 + ,329) > par1 = '4' > par1 <- 7 > (n <- length(x)) [1] 289 > (np <- floor(n / par1)) [1] 41 > 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] [,14] [1,] 396 109 885 639 513 992 503 918 218 379 711 657 430 437 [2,] 297 371 497 963 469 238 927 1635 764 825 503 385 451 711 [3,] 559 656 1436 398 683 818 1269 330 255 798 382 577 537 299 [4,] 967 511 612 410 643 937 537 557 454 663 464 619 519 248 [5,] 270 655 865 966 535 70 910 1178 866 1069 717 479 1000 1162 [6,] 143 465 385 801 625 507 532 740 574 921 690 817 637 714 [7,] 1562 525 567 892 264 260 345 452 1276 858 462 752 465 905 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 649 617 214 508 370 617 274 417 694 356 230 671 [2,] 512 925 599 506 316 411 502 276 1024 457 651 861 [3,] 472 351 572 451 603 975 382 514 400 1402 1367 319 [4,] 905 1144 897 699 154 146 964 822 397 600 564 612 [5,] 786 669 819 407 229 705 537 389 350 480 716 433 [6,] 489 707 720 465 577 184 438 466 719 595 747 434 [7,] 479 458 273 245 192 200 369 1255 1277 436 467 503 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 85 239 376 389 387 229 93 312 367 387 67 106 [2,] 564 438 225 565 339 224 581 507 210 490 397 189 [3,] 824 459 555 173 181 203 248 224 335 238 467 194 [4,] 74 426 252 278 245 333 304 340 364 343 178 135 [5,] 259 288 208 609 384 384 344 168 178 232 175 201 [6,] 69 498 130 422 212 636 407 443 206 530 299 207 [7,] 535 454 481 445 399 185 170 204 279 291 154 280 [,39] [,40] [,41] [1,] 260 350 299 [2,] 227 186 300 [3,] 239 326 450 [4,] 333 155 183 [5,] 428 75 238 [6,] 230 361 165 [7,] 292 261 234 > 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] 599.1429 470.2857 749.5714 724.1429 533.1429 546.0000 717.5714 830.0000 [9] 629.5714 787.5714 561.2857 612.2857 577.0000 639.4286 613.1429 695.8571 [17] 584.8571 468.7143 348.7143 462.5714 495.1429 591.2857 694.4286 618.0000 [25] 677.4286 547.5714 344.2857 400.2857 318.1429 411.5714 306.7143 313.4286 [33] 306.7143 314.0000 277.0000 358.7143 248.1429 187.4286 287.0000 244.8571 [41] 267.0000 > arr.sd [1] 502.15915 188.71205 353.98016 245.60634 141.37707 372.05242 325.79536 [8] 456.87088 373.15049 218.29785 140.29221 149.52226 198.96482 332.76060 [15] 173.15834 269.53814 260.02399 135.49258 180.32537 314.80833 224.53985 [22] 338.16057 351.75600 356.42718 351.15849 181.60383 299.47494 97.11285 [29] 156.28545 152.21241 91.79817 159.80703 160.46777 126.54775 79.96666 [36] 117.49853 144.10000 55.62031 72.92005 109.37615 95.73575 > arr.range [1] 1419 547 1051 568 419 922 924 1305 1058 690 335 432 570 914 433 [16] 793 683 454 449 829 690 979 927 1046 1137 542 755 259 425 436 [31] 218 451 488 339 189 298 400 174 201 286 285 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -11.2884 0.4675 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -1.460 1.095 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -63.061 1.371 > postscript(file="/var/wessaorg/rcomp/tmp/1a9451324394987.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/2frby1324394987.ps",horizontal=F,onefile=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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/30jwo1324394987.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/wessaorg/rcomp/tmp/4wr9z1324394987.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/wessaorg/rcomp/tmp/53xiv1324394987.tab") > > try(system("convert tmp/1a9451324394987.ps tmp/1a9451324394987.png",intern=TRUE)) character(0) > try(system("convert tmp/2frby1324394987.ps tmp/2frby1324394987.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.815 0.222 1.031