R version 2.9.0 (2009-04-17) 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(36.80,35.40,33.00,28.73,26.70,26.46,24.60,28.00,31.60,33.50,34.50,35.00,34.76,33.50,32.74,34.40,31.93,29.24,25.75,26.03,26.08,23.80,20.61,19.70,18.18,19.60,20.60,20.03,23.00,23.60,22.56,22.55,23.75,24.92,24.50,30.58,28.07,27.70,27.00,25.23,26.86,25.60,24.55,23.96,23.50,23.64,21.55,21.05,21.89,21.98,21.45,22.15,22.58,23.80,23.30,22.38,23.00,21.96,22.40,20.80,20.40,16.00,12.78,9.75,7.50,11.24,12.24,12.75,12.52,14.49,14.21,14.32,22.15,22.58,23.80,23.30,22.38,23.00,21.96,22.40,20.80,20.40,16.00,12.78,9.75,7.50,11.24,12.24,12.75,12.52,14.49,14.21,14.32) > 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] 93 > (np <- floor(n / par1)) [1] 23 > 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,] 36.80 26.70 31.6 34.76 31.93 26.08 18.18 23.00 23.75 28.07 26.86 23.50 [2,] 35.40 26.46 33.5 33.50 29.24 23.80 19.60 23.60 24.92 27.70 25.60 23.64 [3,] 33.00 24.60 34.5 32.74 25.75 20.61 20.60 22.56 24.50 27.00 24.55 21.55 [4,] 28.73 28.00 35.0 34.40 26.03 19.70 20.03 22.55 30.58 25.23 23.96 21.05 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [1,] 21.89 22.58 23.00 20.40 7.50 12.52 22.15 22.38 20.80 9.75 12.75 [2,] 21.98 23.80 21.96 16.00 11.24 14.49 22.58 23.00 20.40 7.50 12.52 [3,] 21.45 23.30 22.40 12.78 12.24 14.21 23.80 21.96 16.00 11.24 14.49 [4,] 22.15 22.38 20.80 9.75 12.75 14.32 23.30 22.40 12.78 12.24 14.21 > 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] 33.4825 26.4400 33.6500 33.8500 28.2375 22.5475 19.6025 22.9275 25.9375 [10] 27.0000 25.2425 22.4350 21.8675 23.0150 22.0400 14.7325 10.9325 13.8850 [19] 22.9575 22.4350 17.4950 10.1825 13.4925 > arr.sd [1] 3.5356129 1.4008569 1.5022206 0.9101648 2.9269025 2.9387909 1.0330013 [8] 0.4950000 3.1326067 1.2606612 1.2739015 1.3276169 0.2984823 0.6557184 [15] 0.9300896 4.5594106 2.3727252 0.9172604 0.7352267 0.4278240 3.8222288 [22] 2.0602973 1.0011452 > arr.range [1] 8.07 3.40 3.40 2.02 6.18 6.38 2.42 1.05 6.83 2.84 2.90 2.59 [13] 0.70 1.42 2.20 10.65 5.25 1.97 1.65 1.04 8.02 4.74 1.97 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 2.02052 -0.01352 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 1.0311 -0.2406 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 4.45759 -0.02884 > postscript(file="/var/www/html/rcomp/tmp/1zpp21244400893.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/29y861244400893.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/3hd4y1244400893.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/4lxuq1244400893.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/5vcwm1244400893.tab") > > system("convert tmp/1zpp21244400893.ps tmp/1zpp21244400893.png") > system("convert tmp/29y861244400893.ps tmp/29y861244400893.png") > > > proc.time() user system elapsed 0.504 0.297 0.639