R version 2.7.0 (2008-04-22) 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(2.1300,1.8700,2.2300,3.0000,2.1200,1.6000,1.1700,1.0200,1.2200,1.8000,2.1300,2.2100,2.3800,1.9900,1.8200,2.4700,1.9400,1.3900,1.1100,0.9700,1.3800,2.3900,1.8800,2.1100,2.1100,2.1700,2.5400,3.1300,2.2500,1.3900,1.3600,1.3300,1.6000,1.9500,2.2300,2.5300,2.3600,1.9500,2.1600,2.7600,2.0900,1.4900,1.1700,1.3000,1.2600,2.1700,2.0300,2.1800,2.6100,2.5800,3.8600,3.8100,2.4100,1.4700,1.3300,1.3800,1.5700,2.6000,2.1800,2.3600,2.2400,2.4100,2.5100,2.9800,1.8700,1.9000,1.4700,1.4500,2.7100,2.9000,2.1100,2.1800,2.2400,2.0500,2.4200,2.7700,1.9900,1.4700,1.0900,0.9300,1.3200,2.0300,2.0400,2.7800,2.8000,3.0300,3.1100,2.7500,2.7800,1.7600,1.2900,1.2800,1.4300,1.7100,1.8900,1.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] 96 > (np <- floor(n / par1)) [1] 24 > 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,] 2.13 2.12 1.22 2.38 1.94 1.38 2.11 2.25 1.60 2.36 2.09 1.26 2.61 2.41 [2,] 1.87 1.60 1.80 1.99 1.39 2.39 2.17 1.39 1.95 1.95 1.49 2.17 2.58 1.47 [3,] 2.23 1.17 2.13 1.82 1.11 1.88 2.54 1.36 2.23 2.16 1.17 2.03 3.86 1.33 [4,] 3.00 1.02 2.21 2.47 0.97 2.11 3.13 1.33 2.53 2.76 1.30 2.18 3.81 1.38 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 1.57 2.24 1.87 2.71 2.24 1.99 1.32 2.80 2.78 1.43 [2,] 2.60 2.41 1.90 2.90 2.05 1.47 2.03 3.03 1.76 1.71 [3,] 2.18 2.51 1.47 2.11 2.42 1.09 2.04 3.11 1.29 1.89 [4,] 2.36 2.98 1.45 2.18 2.77 0.93 2.78 2.75 1.28 1.84 > 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] 2.3075 1.4775 1.8400 2.1650 1.3525 1.9400 2.4875 1.5825 2.0775 2.3075 [11] 1.5125 1.9100 3.2150 1.6475 2.1775 2.5350 1.6725 2.4750 2.3700 1.3700 [21] 2.0425 2.9225 1.7775 1.7175 > arr.sd [1] 0.4859612 0.4938539 0.4498148 0.3103224 0.4288259 0.4276291 0.4686417 [8] 0.4456736 0.3967682 0.3450000 0.4068067 0.4387102 0.7163100 0.5116232 [15] 0.4400284 0.3169122 0.2458150 0.3899145 0.3064855 0.4713102 0.5961194 [22] 0.1746186 0.7048581 0.2061351 > arr.range [1] 1.13 1.10 0.99 0.65 0.97 1.01 1.02 0.92 0.93 0.81 0.92 0.92 1.28 1.08 1.03 [16] 0.74 0.45 0.79 0.72 1.06 1.46 0.36 1.50 0.46 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 0.437588 -0.006628 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -0.7814 -0.1861 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 1.07190 -0.07008 > postscript(file="/var/www/html/rcomp/tmp/1tv4n1217412738.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/rcomp/tmp/27vcr1217412738.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/rcomp/tmp/31p3x1217412738.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/rcomp/tmp/439al1217412738.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/rcomp/tmp/517tp1217412738.tab") > > system("convert tmp/1tv4n1217412738.ps tmp/1tv4n1217412738.png") > system("convert tmp/27vcr1217412738.ps tmp/27vcr1217412738.png") > > > proc.time() user system elapsed 0.715 0.266 7.025