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(15.14,14.2,13.83,14.31,14.04,14.9,14.92,15.36,15.5,15.65,16.18,15.44,15.58,15.24,15.33,16.07,15.82,15.87,15.72,17.07,16.83,17.52,17.76,17.36,17.95,16.71,17.14,16.72,17.26,17.24,17.69,18.13,18.08,18.18,18.18,17.64,17.89,16.82,16.61,16.66,17.02,16.91,17.18,18.06,17.58,17.48,17.54,17.44,17.79,16.79,16.19,16.62,16.39,16.54,17.26,18,17.29,18.16,17.82,17.48,18.31,17.04,17.03,16.97,17.11,17.12,17.69,18.5,18.27,18.45,18.35,18.03,18.49,18.07,17.8,17.88,18.12,18.68,18.8,19.64,19.56,19.3,20.07,19.82,20.29,19.36,18.74,18.87,18.87,18.91,19.31,20.06,20.72,20.42,20.58,20.58,21.18,19.87,19.83,19.48,19.49,19.4,19.89,20.44,20.07,19.75,19.54,19.07,19.55,18.01,17.5,17.41,17.47,17.6,17.64,18.3,18.27,17.99,18.04,17.62,18.22,17.67,17.73,17.99,18.15,18.41,18.36,19.52,19.96,19.6,19.48,19.13) > 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] 132 > (np <- floor(n / par1)) [1] 33 > 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,] 15.14 14.04 15.50 15.58 15.82 16.83 17.95 17.26 18.08 17.89 17.02 17.58 [2,] 14.20 14.90 15.65 15.24 15.87 17.52 16.71 17.24 18.18 16.82 16.91 17.48 [3,] 13.83 14.92 16.18 15.33 15.72 17.76 17.14 17.69 18.18 16.61 17.18 17.54 [4,] 14.31 15.36 15.44 16.07 17.07 17.36 16.72 18.13 17.64 16.66 18.06 17.44 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 17.79 16.39 17.29 18.31 17.11 18.27 18.49 18.12 19.56 20.29 18.87 20.72 [2,] 16.79 16.54 18.16 17.04 17.12 18.45 18.07 18.68 19.30 19.36 18.91 20.42 [3,] 16.19 17.26 17.82 17.03 17.69 18.35 17.80 18.80 20.07 18.74 19.31 20.58 [4,] 16.62 18.00 17.48 16.97 18.50 18.03 17.88 19.64 19.82 18.87 20.06 20.58 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [1,] 21.18 19.49 20.07 19.55 17.47 18.27 18.22 18.15 19.96 [2,] 19.87 19.40 19.75 18.01 17.60 17.99 17.67 18.41 19.60 [3,] 19.83 19.89 19.54 17.50 17.64 18.04 17.73 18.36 19.48 [4,] 19.48 20.44 19.07 17.41 18.30 17.62 17.99 19.52 19.13 > 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] 14.3700 14.8050 15.6925 15.5550 16.1200 17.3675 17.1300 17.5800 18.0200 [10] 16.9950 17.2925 17.5100 16.8475 17.0475 17.6875 17.3375 17.6050 18.2750 [19] 18.0600 18.8100 19.6875 19.3150 19.2875 20.5750 20.0900 19.8050 19.6075 [28] 18.1175 17.7525 17.9800 17.9025 18.6100 19.5425 > arr.sd [1] 0.55287129 0.55241892 0.33678628 0.37224544 0.63639610 0.39423977 [7] 0.58223707 0.42134705 0.25768197 0.60335175 0.52353765 0.06218253 [13] 0.67716935 0.73988175 0.38378596 0.64906985 0.65536250 0.17916473 [19] 0.30822070 0.62769419 0.33180064 0.70268533 0.55198883 0.12261049 [25] 0.74748467 0.47388466 0.41939440 0.99087083 0.37214469 0.26919633 [31] 0.25316332 0.61703593 0.34238137 > arr.range [1] 1.31 1.32 0.74 0.83 1.35 0.93 1.24 0.89 0.54 1.28 1.15 0.14 1.60 1.61 0.87 [16] 1.34 1.39 0.42 0.69 1.52 0.77 1.55 1.19 0.30 1.70 1.04 1.00 2.14 0.83 0.65 [31] 0.55 1.37 0.83 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 0.76470 -0.01619 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 2.090 -1.026 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 1.67367 -0.03425 > postscript(file="/var/wessaorg/rcomp/tmp/1gkh01322555757.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/20g5s1322555757.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/38lx61322555757.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/40v0k1322555757.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/5pkz81322555757.tab") > > try(system("convert tmp/1gkh01322555757.ps tmp/1gkh01322555757.png",intern=TRUE)) character(0) > try(system("convert tmp/20g5s1322555757.ps tmp/20g5s1322555757.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.665 0.136 0.799