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(588264,577918,567562,546859,756344,745987,588264,483527,493873,493873,504229,526055,462824,399492,347630,347630,546859,567562,409838,231412,325803,325803,399492,442021,431664,325803,378790,357986,536412,493873,325803,200263,315447,347630,378790,420195,336150,263595,294755,305101,577918,577918,420195,399492,462824,431664,515709,620447,641250,493873,452367,409838,694135,714939,661953,714939,704481,620447,714939,819676,862205,735641,651596,714939,987746,1071790,1051088,1092483,1082137,977399,1155825,1198354,1260562,1071790,998102,1082137,1282389,1460814,1418286,1418286,1439089,1366423,1555307,1555307,1523124,1344597,1376780,1397583,1534503,1712929,1586355,1649698,1596712,1565653,1807421,1754435,1680746,1576009,1680746,1733732,1796963,1880998,1796963,1848826,1785585,1775239,2037699,2059525,1975491,1828123,1953664,2006549,2069882,2164273,2069882,2143570,2111388,1996193,2237951,2237951) > 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] 120 > (np <- floor(n / par1)) [1] 30 > 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] [1,] 588264 756344 493873 462824 546859 325803 431664 536412 315447 336150 [2,] 577918 745987 493873 399492 567562 325803 325803 493873 347630 263595 [3,] 567562 588264 504229 347630 409838 399492 378790 325803 378790 294755 [4,] 546859 483527 526055 347630 231412 442021 357986 200263 420195 305101 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 577918 462824 641250 694135 704481 862205 987746 1082137 1260562 1282389 [2,] 577918 431664 493873 714939 620447 735641 1071790 977399 1071790 1460814 [3,] 420195 515709 452367 661953 714939 651596 1051088 1155825 998102 1418286 [4,] 399492 620447 409838 714939 819676 714939 1092483 1198354 1082137 1418286 [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [1,] 1439089 1523124 1534503 1596712 1680746 1796963 1785585 1975491 2069882 [2,] 1366423 1344597 1712929 1565653 1576009 1880998 1775239 1828123 2164273 [3,] 1555307 1376780 1586355 1807421 1680746 1796963 2037699 1953664 2069882 [4,] 1555307 1397583 1649698 1754435 1733732 1848826 2059525 2006549 2143570 [,30] [1,] 2111388 [2,] 1996193 [3,] 2237951 [4,] 2237951 > 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] 570150.8 643530.5 504507.5 389394.0 438917.8 373279.8 373560.8 [8] 389087.8 365515.5 299900.2 493880.8 507661.0 499332.0 696491.5 [15] 714885.8 741095.2 1050776.8 1103428.8 1103147.8 1394943.8 1479031.5 [22] 1410521.0 1620871.2 1681055.2 1667808.2 1830937.5 1914512.0 1940956.8 [29] 2111901.8 2145870.8 > arr.sd [1] 17678.87 131503.77 15171.88 54718.67 155032.17 57505.14 44447.38 [8] 155289.12 44694.54 29920.10 97405.24 82807.71 100640.29 25027.20 [15] 81665.86 88301.73 45291.43 96769.50 111413.07 77668.49 92937.22 [22] 78169.17 77365.92 118017.45 66100.46 41370.62 155159.00 78289.82 [29] 49250.87 116261.25 > arr.range [1] 41405 272817 32182 115194 336150 116218 105861 336149 104748 72555 [11] 178426 188783 231412 52986 199229 210609 104737 220955 262460 178425 [21] 188884 178527 178426 241768 157723 84035 284286 178426 94391 241758 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 6.851e+04 1.085e-02 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 7.847 0.241 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 1.554e+05 1.733e-02 > postscript(file="/var/wessaorg/rcomp/tmp/13p3w1312453324.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/2p1v21312453324.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/3i68o1312453324.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/49gmv1312453325.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/5by8z1312453325.tab") > > try(system("convert tmp/13p3w1312453324.ps tmp/13p3w1312453324.png",intern=TRUE)) character(0) > try(system("convert tmp/2p1v21312453324.ps tmp/2p1v21312453324.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.648 0.120 0.759