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(0.440,0.548,0.163,0.381,0.164,0.109,0.328,0.435,0.325,0.108,0.054,0.270,0.431,0.215,0.214,0.160,0.427,0.372,0.106,0.053,0.317,0.527,0.472,0.000,0.052,0.418,0.364,0.311,0.052,0.052,0.620,0.616,1.377,0.151,0.502,0.000,0.606,0.050,0.150,0.501,0.299,0.248,0.545,0.444,0.491,0.444,0.050,0.545,0.138,0.423,0.495,0.370,0.388,0.169,0.241,0.014,0.376,0.331,0.789,0.289,0.359,0.236,0.367,0.309,0.551,0.901,0.870,0.160,0.032,0.877,1.812,0.784,0.270,0.462,0.146,0.108,0.132,0.680,0.117,0.345,0.204,0.227,0.236,0.092,0.138,0.046,0.023,0.009,0.142,0.207,0.346,0.207,0.165,0.247,0.123,0.433) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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,] 0.440 0.431 0.052 0.606 0.138 0.359 0.270 0.138 [2,] 0.548 0.215 0.418 0.050 0.423 0.236 0.462 0.046 [3,] 0.163 0.214 0.364 0.150 0.495 0.367 0.146 0.023 [4,] 0.381 0.160 0.311 0.501 0.370 0.309 0.108 0.009 [5,] 0.164 0.427 0.052 0.299 0.388 0.551 0.132 0.142 [6,] 0.109 0.372 0.052 0.248 0.169 0.901 0.680 0.207 [7,] 0.328 0.106 0.620 0.545 0.241 0.870 0.117 0.346 [8,] 0.435 0.053 0.616 0.444 0.014 0.160 0.345 0.207 [9,] 0.325 0.317 1.377 0.491 0.376 0.032 0.204 0.165 [10,] 0.108 0.527 0.151 0.444 0.331 0.877 0.227 0.247 [11,] 0.054 0.472 0.502 0.050 0.789 1.812 0.236 0.123 [12,] 0.270 0.000 0.000 0.545 0.289 0.784 0.092 0.433 > 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] 0.2770833 0.2745000 0.3762500 0.3644167 0.3352500 0.6048333 0.2515833 [8] 0.1738333 > arr.sd [1] 0.1575445 0.1744964 0.3870723 0.1982769 0.1966881 0.4853229 0.1731098 [8] 0.1263414 > arr.range [1] 0.494 0.527 1.377 0.556 0.775 1.780 0.588 0.424 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -0.06125 0.89884 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -0.2166 1.1412 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -0.3202 3.4175 > postscript(file="/var/yougetitorg/rcomp/tmp/17o6g1305829486.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/2n73k1305829486.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/3dgrs1305829486.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/4c96r1305829486.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/5gwm91305829486.tab") > > try(system("convert tmp/17o6g1305829486.ps tmp/17o6g1305829486.png",intern=TRUE)) character(0) > try(system("convert tmp/2n73k1305829486.ps tmp/2n73k1305829486.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.620 0.310 0.859