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(34671,34355,34035,33373,39924,39577,34671,31409,31724,31724,32075,32706,34671,34035,35017,36631,45813,45813,43853,41888,43502,45466,45813,46795,49742,47777,47777,50724,58893,59555,57911,53982,56928,56928,57244,58893,60191,60853,60853,62817,70355,72315,72630,67724,70355,69373,67408,71653,72630,70986,71333,73613,82133,86372,86372,84412,87355,84412,82764,89004,89981,87670,93559,95870,102741,107301,106670,106319,108950,108630,104706,110594,112559,110594,118763,122692,131839,135448,134470,132505,134150,136114,129559,134785,138079,136750,145265,148207,160652,162932,159990,161634,162616,163598,157358,163247,166509,163247,172749,175692,188451,190416,191047,194340,194340,195638,189749,192696,194656,191047,201527,203491,216567,218878,222140,225087,225402,225749,219860,225749) > 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] [,11] [,12] [1,] 34671 39924 31724 34671 45813 43502 49742 58893 56928 60191 70355 70355 [2,] 34355 39577 31724 34035 45813 45466 47777 59555 56928 60853 72315 69373 [3,] 34035 34671 32075 35017 43853 45813 47777 57911 57244 60853 72630 67408 [4,] 33373 31409 32706 36631 41888 46795 50724 53982 58893 62817 67724 71653 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [1,] 72630 82133 87355 89981 102741 108950 112559 131839 134150 138079 160652 [2,] 70986 86372 84412 87670 107301 108630 110594 135448 136114 136750 162932 [3,] 71333 86372 82764 93559 106670 104706 118763 134470 129559 145265 159990 [4,] 73613 84412 89004 95870 106319 110594 122692 132505 134785 148207 161634 [,24] [,25] [,26] [,27] [,28] [,29] [,30] [1,] 162616 166509 188451 194340 194656 216567 225402 [2,] 163598 163247 190416 195638 191047 218878 225749 [3,] 157358 172749 191047 189749 201527 222140 219860 [4,] 163247 175692 194340 192696 203491 225087 225749 > 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] 34108.50 36395.25 32057.25 35088.50 44341.75 45394.00 49005.00 [8] 57585.25 57498.25 61178.50 70756.00 69697.25 72140.50 84822.25 [15] 85883.75 91770.00 105757.75 108220.00 116152.00 133565.50 133652.00 [22] 142075.25 161302.00 161704.75 169549.25 191063.50 193105.75 197680.25 [29] 220668.00 224190.00 > arr.sd [1] 554.8366 4099.2413 463.0705 1105.8311 1878.7335 1381.2084 1473.5556 [8] 2495.3055 941.6901 1136.0368 2258.0362 1789.1708 1210.0679 2016.9135 [15] 2816.5833 3652.4440 2051.7962 2495.6677 5579.4245 1680.0187 2848.7299 [22] 5540.7931 1279.4488 2926.1774 5684.2840 2448.1379 2541.0843 5822.6109 [29] 3729.0144 2891.2976 > arr.range [1] 1298 8515 982 2596 3925 3293 2947 5573 1965 2626 4906 4245 [13] 2627 4239 6240 8200 4560 5888 12098 3609 6555 11457 2942 6240 [25] 12445 5889 5889 12444 8520 5889 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 1136.9261 0.0134 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 0.08546 0.66486 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 2.480e+03 2.956e-02 > postscript(file="/var/wessaorg/rcomp/tmp/1k0tf1312281499.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/2v0ty1312281499.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/3dwey1312281499.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/4ysh91312281499.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/5e2u21312281499.tab") > > try(system("convert tmp/1k0tf1312281499.ps tmp/1k0tf1312281499.png",intern=TRUE)) character(0) > try(system("convert tmp/2v0ty1312281499.ps tmp/2v0ty1312281499.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.627 0.099 0.724