R version 2.6.2 (2008-02-08) Copyright (C) 2008 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(6.5300,6.5400,6.5400,6.5100,6.5100,6.4900,6.4600,6.4600,6.5200,6.4800,6.4900,6.4800,6.5300,6.4900,6.4800,6.5700,6.5300,6.5700,6.5500,6.5700,6.6200,6.5600,6.6500,6.5900,6.6800,6.7500,6.7700,6.8200,6.8800,6.8100,6.8700,6.9100,6.9800,7.0400,6.9900,7.0800,7.1300,7.1000,7.0200,7.0300,7.1200,7.1100,7.0900,7.0200,7.0300,7.0600,7.0500,7.1100,7.0600,7.0500,7.1100,7.0900,7.1300,7.0300,7.0600,7.1100,7.0800,7.1300,7.0000,7.0200,6.9600,6.9800,7.0200,7.0200,7.0600,7.0200,6.9400,6.9700,6.9700,6.9400,6.9300,7.0000,6.9700,6.9700,6.9800,6.9200,7.0000,6.9400,6.9700,6.9300,6.9200,6.8400,6.8600,6.8600,6.8400) > 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] 85 > (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] [,10] [,11] [,12] [,13] [,14] [1,] 6.53 6.51 6.52 6.53 6.53 6.62 6.68 6.88 6.98 7.13 7.12 7.03 7.06 7.13 [2,] 6.54 6.49 6.48 6.49 6.57 6.56 6.75 6.81 7.04 7.10 7.11 7.06 7.05 7.03 [3,] 6.54 6.46 6.49 6.48 6.55 6.65 6.77 6.87 6.99 7.02 7.09 7.05 7.11 7.06 [4,] 6.51 6.46 6.48 6.57 6.57 6.59 6.82 6.91 7.08 7.03 7.02 7.11 7.09 7.11 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] 7.08 6.96 7.06 6.97 6.97 7.00 6.92 [2,] 7.13 6.98 7.02 6.94 6.97 6.94 6.84 [3,] 7.00 7.02 6.94 6.93 6.98 6.97 6.86 [4,] 7.02 7.02 6.97 7.00 6.92 6.93 6.86 > 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] 6.5300 6.4800 6.4925 6.5175 6.5550 6.6050 6.7550 6.8675 7.0225 7.0700 [11] 7.0850 7.0625 7.0775 7.0825 7.0575 6.9950 6.9975 6.9600 6.9600 6.9600 [21] 6.8700 > arr.sd [1] 0.01414214 0.02449490 0.01892969 0.04112988 0.01914854 0.03872983 [7] 0.05802298 0.04193249 0.04645787 0.05354126 0.04509250 0.03403430 [13] 0.02753785 0.04573474 0.05909033 0.03000000 0.05315073 0.03162278 [19] 0.02708013 0.03162278 0.03464102 > arr.range [1] 0.03 0.05 0.04 0.09 0.04 0.09 0.14 0.10 0.10 0.11 0.10 0.08 0.06 0.10 0.13 [16] 0.06 0.12 0.07 0.06 0.07 0.08 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -0.16099 0.02887 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -15.941 6.534 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -0.3508 0.0631 > postscript(file="/var/www/html/freestat/rcomp/tmp/1kgue1210577212.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/freestat/rcomp/tmp/27e0p1210577212.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/3rfva1210577212.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/freestat/rcomp/tmp/46aa71210577213.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/freestat/rcomp/tmp/5a7q11210577213.tab") > > system("convert tmp/1kgue1210577212.ps tmp/1kgue1210577212.png") > system("convert tmp/27e0p1210577212.ps tmp/27e0p1210577212.png") > > > proc.time() user system elapsed 1.011 0.399 1.061