R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(1664.81,2397.53,2840.71,3547.29,3752.96,3714.74,4349.61,3566.34,5021.82,6423.48,7600.60,19756.21,2499.81,5198.24,7225.14,4806.03,5900.88,4951.34,6179.12,4752.15,5496.43,5835.10,12600.08,28541.72,4717.02,5702.63,9957.58,5304.78,6492.43,6630.80,7349.62,8176.62,8573.17,9690.50,15151.84,34061.01,5921.10,5814.58,12421.25,6369.77,7609.12,7224.75,8121.22,7979.25,8093.06,8476.70,17914.66,30114.41,4826.64,6470.23,9638.77,8821.17,8722.37,10209.48,11276.55,12552.22,11637.39,13606.89,21822.11,45060.69,7615.03,9849.69,14558.40,11587.33,9332.56,13082.09,16732.78,19888.61,23933.38,25391.35,36024.80,80721.71,10243.24,11266.88,21826.84,17357.33,15997.79,18601.53,26155.15,28586.52,30505.41,30821.33,46634.38,104660.67) > 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] 84 > (np <- floor(n / par1)) [1] 21 > 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,] 1664.81 3752.96 5021.82 2499.81 5900.88 5496.43 4717.02 6492.43 8573.17 [2,] 2397.53 3714.74 6423.48 5198.24 4951.34 5835.10 5702.63 6630.80 9690.50 [3,] 2840.71 4349.61 7600.60 7225.14 6179.12 12600.08 9957.58 7349.62 15151.84 [4,] 3547.29 3566.34 19756.21 4806.03 4752.15 28541.72 5304.78 8176.62 34061.01 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [1,] 5921.10 7609.12 8093.06 4826.64 8722.37 11637.39 7615.03 9332.56 [2,] 5814.58 7224.75 8476.70 6470.23 10209.48 13606.89 9849.69 13082.09 [3,] 12421.25 8121.22 17914.66 9638.77 11276.55 21822.11 14558.40 16732.78 [4,] 6369.77 7979.25 30114.41 8821.17 12552.22 45060.69 11587.33 19888.61 [,18] [,19] [,20] [,21] [1,] 23933.38 10243.24 15997.79 30505.41 [2,] 25391.35 11266.88 18601.53 30821.33 [3,] 36024.80 21826.84 26155.15 46634.38 [4,] 80721.71 17357.33 28586.52 104660.67 > 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] 2612.585 3845.912 9700.528 4932.305 5445.872 13118.333 6420.503 [8] 7162.368 16869.130 7631.675 7733.585 16149.708 7439.203 10690.155 [15] 23031.770 10902.612 14759.010 41517.810 15173.573 22335.248 53155.448 > arr.sd [1] 789.5654 345.3107 6786.1572 1937.4202 700.1183 10790.2478 [7] 2392.5542 773.5528 11816.1684 3202.1000 402.0849 10358.7738 [13] 2199.4182 1624.2302 15334.0237 2929.7591 4563.1489 26685.7879 [19] 5434.6171 5993.7211 35152.7584 > arr.range [1] 1882.48 783.27 14734.39 4725.33 1426.97 23045.29 5240.56 1684.19 [9] 25487.84 6606.67 896.47 22021.35 4812.13 3829.85 33423.30 6943.37 [17] 10556.05 56788.33 11583.60 12588.73 74155.26 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -2828.4590 0.6972 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -6.241 1.548 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -5697.954 1.473 > postscript(file="/var/www/html/rcomp/tmp/1kib21275727184.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/2vssn1275727184.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/3hart1275727184.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/42tpy1275727184.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/55t641275727184.tab") > > try(system("convert tmp/1kib21275727184.ps tmp/1kib21275727184.png",intern=TRUE)) character(0) > try(system("convert tmp/2vssn1275727184.ps tmp/2vssn1275727184.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.497 0.291 0.815