R version 2.7.0 (2008-04-22) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(14525.87 + ,14295.79 + ,13830.14 + ,14153.22 + ,15418.03 + ,16666.97 + ,16505.21 + ,17135.96 + ,18033.25 + ,17671 + ,17544.22 + ,17677.9 + ,18470.97 + ,18409.96 + ,18941.6 + ,19685.53 + ,19834.71 + ,19598.93 + ,17039.97 + ,16969.28 + ,16973.38 + ,16329.89 + ,16153.34 + ,15311.7 + ,14760.87 + ,14452.93 + ,13720.95 + ,13266.27 + ,12708.47 + ,13411.84 + ,13975.55 + ,12974.89 + ,12151.11 + ,11576.21 + ,9996.83 + ,10438.9 + ,10511.22 + ,10496.2 + ,10300.79 + ,9981.65 + ,11448.79 + ,11384.49 + ,11717.46 + ,10965.88 + ,10352.27 + ,9751.2 + ,9354.01 + ,8792.5 + ,8721.14 + ,8692.94 + ,8570.73 + ,8538.47 + ,8169.75 + ,7905.84 + ,8145.82 + ,8895.71 + ,9676.31 + ,9884.59 + ,10637.44 + ,10717.13 + ,10205.29 + ,10295.98 + ,10892.76 + ,10631.92 + ,11441.08 + ,11950.95 + ,11037.54 + ,11527.72 + ,11383.89 + ,10989.34 + ,11079.42 + ,11028.93 + ,10973 + ,11068.05 + ,11394.84 + ,11545.71 + ,11809.38 + ,11395.64 + ,11082.38 + ,11402.75 + ,11716.87 + ,12204.98 + ,12986.62 + ,13392.79 + ,14368.05 + ,15650.83 + ,16102.64 + ,16187.64 + ,16311.54 + ,17232.97 + ,16397.83 + ,14990.31 + ,15147.55 + ,15786.78 + ,15934.09 + ,16519.44 + ,16101.07 + ,16775.08 + ,17286.32 + ,17741.23 + ,17128.37 + ,17460.53 + ,17611.14 + ,18001.37 + ,17974.77 + ,16460.95 + ,16235.39 + ,16903.36 + ,15543.76 + ,15532.18 + ,13731.31 + ,13547.84 + ,12602.93 + ,13357.7 + ,13995.33 + ,14084.6 + ,13168.91 + ,12989.35 + ,12123.53 + ,9117.03 + ,8531.45) > par1 = '12' > #'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] 121 > (np <- floor(n / par1)) [1] 10 > 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] [1,] 14525.87 18470.97 14760.87 10511.22 8721.14 10205.29 10973.00 14368.05 [2,] 14295.79 18409.96 14452.93 10496.20 8692.94 10295.98 11068.05 15650.83 [3,] 13830.14 18941.60 13720.95 10300.79 8570.73 10892.76 11394.84 16102.64 [4,] 14153.22 19685.53 13266.27 9981.65 8538.47 10631.92 11545.71 16187.64 [5,] 15418.03 19834.71 12708.47 11448.79 8169.75 11441.08 11809.38 16311.54 [6,] 16666.97 19598.93 13411.84 11384.49 7905.84 11950.95 11395.64 17232.97 [7,] 16505.21 17039.97 13975.55 11717.46 8145.82 11037.54 11082.38 16397.83 [8,] 17135.96 16969.28 12974.89 10965.88 8895.71 11527.72 11402.75 14990.31 [9,] 18033.25 16973.38 12151.11 10352.27 9676.31 11383.89 11716.87 15147.55 [10,] 17671.00 16329.89 11576.21 9751.20 9884.59 10989.34 12204.98 15786.78 [11,] 17544.22 16153.34 9996.83 9354.01 10637.44 11079.42 12986.62 15934.09 [12,] 17677.90 15311.70 10438.90 8792.50 10717.13 11028.93 13392.79 16519.44 [,9] [,10] [1,] 16101.07 15543.76 [2,] 16775.08 15532.18 [3,] 17286.32 13731.31 [4,] 17741.23 13547.84 [5,] 17128.37 12602.93 [6,] 17460.53 13357.70 [7,] 17611.14 13995.33 [8,] 18001.37 14084.60 [9,] 17974.77 13168.91 [10,] 16460.95 12989.35 [11,] 16235.39 12123.53 [12,] 16903.36 9117.03 > 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] 16121.463 17809.938 12786.235 10421.372 9046.323 11038.735 11747.751 [8] 15885.806 17139.965 13316.206 > arr.sd [1] 1580.4122 1539.5137 1501.1201 875.2909 955.3782 503.5846 760.8659 [8] 769.6369 653.2786 1674.5342 > arr.range [1] 4203.11 4523.01 4764.04 2924.96 2811.29 1745.66 2419.79 2864.92 1900.30 [10] 6426.73 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 472.436 0.045 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 1.8208 0.5359 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 2072.9243 0.1024 > postscript(file="/var/www/html/rcomp/tmp/1t93d1229371984.ps",horizontal=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/html/rcomp/tmp/2irfa1229371984.ps",horizontal=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/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/html/rcomp/tmp/38f481229371984.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/html/rcomp/tmp/4npee1229371984.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/html/rcomp/tmp/5vahg1229371984.tab") > > system("convert tmp/1t93d1229371984.ps tmp/1t93d1229371984.png") > system("convert tmp/2irfa1229371984.ps tmp/2irfa1229371984.png") > > > proc.time() user system elapsed 1.371 0.444 1.459