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(1069108,1059362,1049495,1029082,1231089,1220388,1069108,968521,978233,978233,989056,1008514,1069108,1049495,1079775,1129547,1412683,1412683,1352244,1291650,1341422,1401983,1412683,1442964,1533833,1473244,1473244,1564114,1816014,1836427,1785734,1664578,1755420,1755420,1765165,1816014,1856040,1876453,1876453,1937014,2169452,2229890,2239603,2088322,2169452,2139171,2078582,2209478,2239603,2188909,2199610,2269916,2532640,2663352,2663352,2602913,2693660,2602913,2552092,2744509,2774634,2703378,2884967,2956228,3168103,3308711,3289258,3278430,3359559,3349692,3228692,3410253,3470847,3410253,3662154,3783309,4065362,4176650,4146492,4085897,4136624,4197185,3995056,4156204,4257779,4216798,4479366,4570080,4953837,5024138,4933418,4984117,5014398,5044678,4852261,5033856,5134437,5033856,5326854,5417607,5811037,5871631,5891089,5992631,5992631,6032657,5851063,5941938,6002377,5891089,6214246,6274812,6678021,6749283,6849864,6940739,6950451,6961152,6779563,6961152) > 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] [1,] 1069108 1231089 978233 1069108 1412683 1341422 1533833 1816014 1755420 [2,] 1059362 1220388 978233 1049495 1412683 1401983 1473244 1836427 1755420 [3,] 1049495 1069108 989056 1079775 1352244 1412683 1473244 1785734 1765165 [4,] 1029082 968521 1008514 1129547 1291650 1442964 1564114 1664578 1816014 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 1856040 2169452 2169452 2239603 2532640 2693660 2774634 3168103 3359559 [2,] 1876453 2229890 2139171 2188909 2663352 2602913 2703378 3308711 3349692 [3,] 1876453 2239603 2078582 2199610 2663352 2552092 2884967 3289258 3228692 [4,] 1937014 2088322 2209478 2269916 2602913 2744509 2956228 3278430 3410253 [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [,27] [1,] 3470847 4065362 4136624 4257779 4953837 5014398 5134437 5811037 5992631 [2,] 3410253 4176650 4197185 4216798 5024138 5044678 5033856 5871631 6032657 [3,] 3662154 4146492 3995056 4479366 4933418 4852261 5326854 5891089 5851063 [4,] 3783309 4085897 4156204 4570080 4984117 5033856 5417607 5992631 5941938 [,28] [,29] [,30] [1,] 6002377 6678021 6950451 [2,] 5891089 6749283 6961152 [3,] 6214246 6849864 6779563 [4,] 6274812 6940739 6961152 > 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] 1051762 1122276 988509 1081981 1367315 1399763 1511109 1775688 1773005 [10] 1886490 2181817 2149171 2224510 2615564 2648294 2829802 3261126 3337049 [19] 3581641 4118600 4121267 4381006 4973878 4986298 5228188 5891597 5954572 [28] 6095631 6804477 6913080 > arr.sd [1] 17109.11 126403.68 14279.26 34100.07 57933.40 42590.51 45436.50 [8] 76945.36 29038.50 35030.27 69628.64 55169.62 37313.74 62192.77 [15] 86851.71 112625.11 63267.81 76955.85 172047.94 51805.85 87843.02 [22] 170853.57 39452.75 90232.14 175279.50 75491.02 78357.06 179544.88 [29] 114985.23 89153.83 > arr.range [1] 40026 262568 30281 80052 121033 101542 90870 171849 60594 80974 [11] 151281 130896 81007 130712 192417 252850 140608 181561 373056 111288 [21] 202129 353282 90720 192417 383751 181594 181594 383723 262718 181589 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 3.506e+04 1.340e-02 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 1.2346 0.6649 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 7.648e+04 2.956e-02 > postscript(file="/var/wessaorg/rcomp/tmp/1j64e1310302256.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/2wkg01310302256.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/33u3n1310302256.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/47vtv1310302256.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/5zk821310302256.tab") > > try(system("convert tmp/1j64e1310302256.ps tmp/1j64e1310302256.png",intern=TRUE)) character(0) > try(system("convert tmp/2wkg01310302256.ps tmp/2wkg01310302256.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.756 0.121 0.872