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(20.98,20.1,20.61,20.27,20.08,23.58,22.31,22.89,21.78,22.19,22.58,22.78,25.06,25.16,25.47,25.34,24.2,25.32,25.57,25.76,24.79,23.14,22.66,22.06,24.26,23.15,22.92,21.43,21.56,23.48,24.35,24.83,24.19,23.58,23.58,24.35,27.18,25.69,24.81,23.26,23.49,26.86,27.12,27.66,26.26,25.51,24.63,23.57,27.63,25.85,26.09,24.47,24.19,25.09,25.26,25.58,24.76,25.02,24.24,24.14,28.69,26.74,26.48,24.45,23.88,26.58,26.23,28.63,26.81,26.56,26.64,26.8,28.37,27.13,28.44,28.62,27.28,31.32,31.26,31.41,31.76,32.72,32.15,33.62,35.97,33.78,33.77,32.75,32.55,33.22,32.88,31.56,30.27,28.65,27.89,27.07,30.8,28.38,27.5,28,28.02,29.2,27.59,27.22,27.16,26.31,25.67,26.41,28.34,25.43,23.72,23.33,23.8,27.7,26.28,27.51,27.93,28.76,28.65,29.52,31.23,27.9,27.87,27.52,27.59,31.2,30.22,30.62,31.52,30.59,31.42,31.95) > 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,] 20.98 20.08 21.78 25.06 24.20 24.79 24.26 21.56 24.19 27.18 23.49 26.26 [2,] 20.10 23.58 22.19 25.16 25.32 23.14 23.15 23.48 23.58 25.69 26.86 25.51 [3,] 20.61 22.31 22.58 25.47 25.57 22.66 22.92 24.35 23.58 24.81 27.12 24.63 [4,] 20.27 22.89 22.78 25.34 25.76 22.06 21.43 24.83 24.35 23.26 27.66 23.57 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 27.63 24.19 24.76 28.69 23.88 26.81 28.37 27.28 31.76 35.97 32.55 30.27 [2,] 25.85 25.09 25.02 26.74 26.58 26.56 27.13 31.32 32.72 33.78 33.22 28.65 [3,] 26.09 25.26 24.24 26.48 26.23 26.64 28.44 31.26 32.15 33.77 32.88 27.89 [4,] 24.47 25.58 24.14 24.45 28.63 26.80 28.62 31.41 33.62 32.75 31.56 27.07 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [1,] 30.80 28.02 27.16 28.34 23.80 27.93 31.23 27.59 31.52 [2,] 28.38 29.20 26.31 25.43 27.70 28.76 27.90 31.20 30.59 [3,] 27.50 27.59 25.67 23.72 26.28 28.65 27.87 30.22 31.42 [4,] 28.00 27.22 26.41 23.33 27.51 29.52 27.52 30.62 31.95 > 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] 20.4900 22.2150 22.3325 25.2575 25.2125 23.1625 22.9400 23.5550 23.9250 [10] 25.2350 26.2825 24.9925 26.0100 25.0300 24.5400 26.5900 26.3300 26.7025 [19] 28.1400 30.3175 32.5625 34.0675 32.5525 28.4700 28.6700 28.0075 26.3875 [28] 25.2050 26.3225 28.7150 28.6300 29.9075 31.3700 > arr.sd [1] 0.3894440 1.5150468 0.4423705 0.1830073 0.6986356 1.1715054 1.1643310 [8] 1.4426018 0.4036913 1.6402540 1.8912496 1.1589183 1.2946042 0.5957069 [15] 0.4198412 1.7343779 1.9463641 0.1228481 0.6815179 2.0259381 0.8077283 [22] 1.3572613 0.7159784 1.3624488 1.4650142 0.8595881 0.6104848 2.2803289 [29] 1.7955941 0.6507688 1.7418955 1.5965249 0.5685654 > arr.range [1] 0.88 3.50 1.00 0.41 1.56 2.73 2.83 3.27 0.77 3.92 4.17 2.69 3.16 1.39 0.88 [16] 4.24 4.75 0.25 1.49 4.13 1.86 3.22 1.66 3.20 3.30 1.98 1.49 5.01 3.90 1.59 [31] 3.71 3.61 1.36 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 0.51228 0.02253 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -3.379 1.006 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 1.27229 0.04763 > postscript(file="/var/wessaorg/rcomp/tmp/1bwyp1322592415.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/2uj6s1322592415.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/36oyq1322592415.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/4dk4t1322592415.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/5kmt01322592415.tab") > > try(system("convert tmp/1bwyp1322592415.ps tmp/1bwyp1322592415.png",intern=TRUE)) character(0) > try(system("convert tmp/2uj6s1322592415.ps tmp/2uj6s1322592415.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.674 0.152 0.832