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(14724,14404,14058,13427,19946,19631,14724,11462,11778,11778,12093,12760,13742,13427,11462,11778,20929,22893,17666,14724,15387,15707,17351,18964,19315,16022,16369,12093,24222,27800,19631,17004,18649,20613,23555,27164,27164,24853,23871,17982,27800,32391,28462,24222,24853,27164,30426,34355,31724,30111,30111,24853,32391,37297,33373,29129,30426,35653,37964,41222,38595,34355,33373,25520,30742,36315,30111,26502,30111,33689,35653,40906,38280,31724,32391,26186,31409,36000,30742,27164,30426,34355,33689,41542,40244,35017,35333,28462,32706,39262,34355,31409,36315,39262,36982,47431,44835,38946,37297,29764,34035,37964,33053,33053,38595,41542,39924,51355,48413,42871,40560,32391,35333,40560,36631,35653,40244,44168,39924,50057) > 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,] 14724 19946 11778 13742 20929 15387 19315 24222 18649 27164 27800 24853 [2,] 14404 19631 11778 13427 22893 15707 16022 27800 20613 24853 32391 27164 [3,] 14058 14724 12093 11462 17666 17351 16369 19631 23555 23871 28462 30426 [4,] 13427 11462 12760 11778 14724 18964 12093 17004 27164 17982 24222 34355 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 31724 32391 30426 38595 30742 30111 38280 31409 30426 40244 32706 36315 [2,] 30111 37297 35653 34355 36315 33689 31724 36000 34355 35017 39262 39262 [3,] 30111 33373 37964 33373 30111 35653 32391 30742 33689 35333 34355 36982 [4,] 24853 29129 41222 25520 26502 40906 26186 27164 41542 28462 31409 47431 [,25] [,26] [,27] [,28] [,29] [,30] [1,] 44835 34035 38595 48413 35333 40244 [2,] 38946 37964 41542 42871 40560 44168 [3,] 37297 33053 39924 40560 36631 39924 [4,] 29764 33053 51355 32391 35653 50057 > 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] 14153.25 16440.75 12102.25 12602.25 19053.00 16852.25 15949.75 22164.25 [9] 22495.25 23467.50 28218.75 29199.50 29199.75 33047.50 36316.25 32960.75 [17] 30917.50 35089.75 32145.25 31328.75 35003.00 34764.00 34433.00 39997.50 [25] 37710.50 34526.25 42854.00 41058.75 37044.25 43598.25 > arr.sd [1] 555.3206 4090.6257 462.9603 1148.7385 3602.2672 1649.9288 2965.3791 [8] 4797.2752 3708.4049 3908.8466 3347.4469 4127.9052 2995.9321 3364.0172 [15] 4542.9949 5453.5437 4054.2525 4505.4066 4945.8960 3629.3450 4685.2232 [22] 4835.0586 3437.6557 5113.7699 6207.5976 2338.1177 5794.0293 6652.0144 [29] 2407.9886 4718.4451 > arr.range [1] 1297 8484 982 2280 8169 3577 7222 10796 8515 9182 8169 9502 [13] 6871 8168 10796 13075 9813 10795 12094 8836 11116 11782 7853 11116 [25] 15071 4911 12760 16022 5227 10133 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 421.0951 0.1159 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -4.645 1.248 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 803.765 0.275 > postscript(file="/var/wessaorg/rcomp/tmp/1ap9u1313702310.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/2mpyc1313702310.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/3b5zg1313702310.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/4gsk71313702310.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/5vmuk1313702310.tab") > > try(system("convert tmp/1ap9u1313702310.ps tmp/1ap9u1313702310.png",intern=TRUE)) character(0) > try(system("convert tmp/2mpyc1313702310.ps tmp/2mpyc1313702310.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.643 0.135 0.775