R version 2.12.1 (2010-12-16) Copyright (C) 2010 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(58109,57087,56064,54019,74712,73689,58109,47763,48785,48785,49808,51964,45718,39462,34339,34339,54019,56064,40484,22859,32183,32183,39462,43663,42640,32183,37417,35362,52987,48785,32183,19782,31160,34339,37417,41507,33205,26038,29116,30138,57087,57087,41507,39462,45718,42640,50942,61288,63343,48785,44685,40484,68567,70622,65388,70622,69589,61288,70622,80968,85169,72667,64365,70622,97570,105872,103827,107916,106894,96548,114173,118374,124519,105872,98593,106894,126675,144300,140099,140099,142154,134976,153634,153634,150455,132820,135999,138054,151579,169204,156701,162958,157724,154656,178538,173304,166025,155679,166025,171259,177505,185806,177505,182628,176381,175359,201285,203441,195140,180583,192984,198208,204464,213788,204464,211743,208564,197185,221066,221066) > 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,] 58109 74712 48785 45718 54019 32183 42640 52987 31160 33205 57087 45718 [2,] 57087 73689 48785 39462 56064 32183 32183 48785 34339 26038 57087 42640 [3,] 56064 58109 49808 34339 40484 39462 37417 32183 37417 29116 41507 50942 [4,] 54019 47763 51964 34339 22859 43663 35362 19782 41507 30138 39462 61288 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [1,] 63343 68567 69589 85169 97570 106894 124519 126675 142154 150455 151579 [2,] 48785 70622 61288 72667 105872 96548 105872 144300 134976 132820 169204 [3,] 44685 65388 70622 64365 103827 114173 98593 140099 153634 135999 156701 [4,] 40484 70622 80968 70622 107916 118374 106894 140099 153634 138054 162958 [,24] [,25] [,26] [,27] [,28] [,29] [,30] [1,] 157724 166025 177505 176381 195140 204464 208564 [2,] 154656 155679 185806 175359 180583 213788 197185 [3,] 178538 166025 177505 201285 192984 204464 221066 [4,] 173304 171259 182628 203441 198208 211743 221066 > 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] 56319.75 63568.25 49835.50 38464.50 43356.50 36872.75 36900.50 [8] 38434.25 36105.75 29624.25 48785.75 50147.00 49324.25 68799.75 [15] 70616.75 73205.75 103796.25 108997.25 108969.50 137793.25 146099.50 [22] 139332.00 160110.50 166055.50 164747.00 180861.00 189116.50 191728.75 [29] 208614.75 211970.25 > arr.sd [1] 1746.324 12990.023 1498.707 5405.176 15314.135 5680.353 4390.536 [8] 15339.547 4414.926 2955.516 9621.747 8179.751 9941.308 2472.206 [15] 8067.016 8722.466 4473.932 9558.928 11005.467 7672.163 9180.352 [22] 7721.603 7642.233 11657.845 6529.455 4086.595 15326.725 7733.492 [29] 4865.042 11484.359 > arr.range [1] 4090 26949 3179 11379 33205 11480 10457 33205 10347 7167 17625 18648 [13] 22859 5234 19680 20804 10346 21826 25926 17625 18658 17635 17625 23882 [25] 15580 8301 28082 17625 9324 23881 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 6.768e+03 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) 6.0901 0.2410 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 1.535e+04 1.733e-02 > postscript(file="/var/www/rcomp/tmp/1973i1313414725.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/www/rcomp/tmp/2udfj1313414725.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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3omdr1313414725.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/rcomp/tmp/4lu9s1313414725.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/rcomp/tmp/5qmmw1313414725.tab") > > try(system("convert tmp/1973i1313414725.ps tmp/1973i1313414725.png",intern=TRUE)) character(0) > try(system("convert tmp/2udfj1313414725.ps tmp/2udfj1313414725.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.840 0.156 0.970