R version 2.10.1 (2009-12-14) 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(12.32,12.34,12.36,12.54,12.77,12.79,12.96,12.96,13,13.19,13.25,13.61,13.8,13.83,14.04,14.16,14.2,14.27,14.31,14.69,14.9,14.92,15.01,15.09,15.14,15.24,15.33,15.36,15.44,15.5,15.58,15.65,15.72,15.82,15.87,16.07,16.18,16.19,16.39,16.54,16.61,16.62,16.66,16.71,16.72,16.79,16.82,16.83,16.91,16.97,17.02,17.03,17.04,17.07,17.11,17.12,17.14,17.18,17.24,17.26,17.26,17.29,17.36,17.44,17.48,17.48,17.52,17.54,17.58,17.64,17.69,17.69,17.76,17.79,17.82,17.89,17.95,18,18.03,18.06,18.08,18.13,18.16,18.18,18.18,18.27,18.31,18.35,18.45,18.5) > 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] 90 > (np <- floor(n / par1)) [1] 22 > 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,] 12.32 12.77 13.00 13.80 14.20 14.90 15.14 15.44 15.72 16.18 16.61 16.72 [2,] 12.34 12.79 13.19 13.83 14.27 14.92 15.24 15.50 15.82 16.19 16.62 16.79 [3,] 12.36 12.96 13.25 14.04 14.31 15.01 15.33 15.58 15.87 16.39 16.66 16.82 [4,] 12.54 12.96 13.61 14.16 14.69 15.09 15.36 15.65 16.07 16.54 16.71 16.83 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [1,] 16.91 17.04 17.14 17.26 17.48 17.58 17.76 17.95 18.08 18.18 [2,] 16.97 17.07 17.18 17.29 17.48 17.64 17.79 18.00 18.13 18.27 [3,] 17.02 17.11 17.24 17.36 17.52 17.69 17.82 18.03 18.16 18.31 [4,] 17.03 17.12 17.26 17.44 17.54 17.69 17.89 18.06 18.18 18.35 > 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] 12.3900 12.8700 13.2625 13.9575 14.3675 14.9800 15.2675 15.5425 15.8700 [10] 16.3250 16.6500 16.7900 16.9825 17.0850 17.2050 17.3375 17.5050 17.6500 [19] 17.8150 18.0100 18.1375 18.2775 > arr.sd [1] 0.10132456 0.10424331 0.25500000 0.17211914 0.21975365 0.08755950 [7] 0.09912114 0.09178780 0.14719601 0.17291616 0.04546061 0.04966555 [13] 0.05500000 0.03696846 0.05507571 0.08015610 0.03000000 0.05228129 [19] 0.05567764 0.04690416 0.04349329 0.07274384 > arr.range [1] 0.22 0.19 0.61 0.36 0.49 0.19 0.22 0.21 0.35 0.36 0.10 0.11 0.12 0.08 0.12 [16] 0.18 0.06 0.11 0.13 0.11 0.10 0.17 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 0.46738 -0.02317 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 7.388 -3.580 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 1.01619 -0.05015 > postscript(file="/var/yougetitorg/rcomp/tmp/1n9by1305063734.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/yougetitorg/rcomp/tmp/2qsig1305063734.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/yougetitorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/yougetitorg/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/yougetitorg/rcomp/tmp/3tk5i1305063734.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/yougetitorg/rcomp/tmp/4oy4u1305063734.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/yougetitorg/rcomp/tmp/5v1oc1305063734.tab") > > try(system("convert tmp/1n9by1305063734.ps tmp/1n9by1305063734.png",intern=TRUE)) character(0) > try(system("convert tmp/2qsig1305063734.ps tmp/2qsig1305063734.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.610 0.370 0.828