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(1.61,1.58,1.69,1.78,1.76,1.83,1.8,1.57,1.45,1.4,1.55,1.58,1.58,1.59,1.8,1.99,2.06,2.06,2.08,2,1.85,1.77,1.7,1.66,1.67,1.73,1.91,2.02,2.07,2.15,2.1,1.68,1.68,1.65,1.72,1.73,1.76,1.84,1.99,2.05,2.12,2.13,2.08,1.88,1.81,1.81,1.88,1.87,1.87,1.9,2.01,2.05,2.16,2.18,2.15,2.12,2.04,2.04,2.06,1.93,1.86,1.94,2.35,2.46,2.59,2.66,2.41,2.18,2.13,2.11,2.12,2.16,2.07,2.2,2.29,2.32,2.37,2.38,2.38,2.28,2.22,2.25,2.3,2.3,2.23,2.27,2.3,2.32,2.41,2.43,2.45,2.47,2.46,2.5,2.46,2.43,2.37,2.45,2.53,2.56,2.62,2.67,2.62,2.6,2.53,2.49,2.48,2.44) > 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] 108 > (np <- floor(n / par1)) [1] 27 > 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,] 1.61 1.76 1.45 1.58 2.06 1.85 1.67 2.07 1.68 1.76 2.12 1.81 1.87 2.16 [2,] 1.58 1.83 1.40 1.59 2.06 1.77 1.73 2.15 1.65 1.84 2.13 1.81 1.90 2.18 [3,] 1.69 1.80 1.55 1.80 2.08 1.70 1.91 2.10 1.72 1.99 2.08 1.88 2.01 2.15 [4,] 1.78 1.57 1.58 1.99 2.00 1.66 2.02 1.68 1.73 2.05 1.88 1.87 2.05 2.12 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 2.04 1.86 2.59 2.13 2.07 2.37 2.22 2.23 2.41 2.46 2.37 2.62 [2,] 2.04 1.94 2.66 2.11 2.20 2.38 2.25 2.27 2.43 2.50 2.45 2.67 [3,] 2.06 2.35 2.41 2.12 2.29 2.38 2.30 2.30 2.45 2.46 2.53 2.62 [4,] 1.93 2.46 2.18 2.16 2.32 2.28 2.30 2.32 2.47 2.43 2.56 2.60 [,27] [1,] 2.53 [2,] 2.49 [3,] 2.48 [4,] 2.44 > 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] 1.6650 1.7400 1.4950 1.7400 2.0500 1.7450 1.8325 2.0000 1.6950 1.9100 [11] 2.0525 1.8425 1.9575 2.1525 2.0175 2.1525 2.4600 2.1300 2.2200 2.3525 [21] 2.2675 2.2800 2.4400 2.4625 2.4775 2.6275 2.4850 > arr.sd [1] 0.08962886 0.11690452 0.08426150 0.19510681 0.03464102 0.08346656 [7] 0.16132266 0.21587033 0.03696846 0.13341664 0.11701140 0.03774917 [13] 0.08616844 0.02500000 0.05909033 0.29680240 0.21432063 0.02160247 [19] 0.11224972 0.04856267 0.03947573 0.03915780 0.02581989 0.02872281 [25] 0.08539126 0.02986079 0.03696846 > arr.range [1] 0.20 0.26 0.18 0.41 0.08 0.19 0.35 0.47 0.08 0.29 0.25 0.07 0.18 0.06 0.13 [16] 0.60 0.48 0.05 0.25 0.10 0.08 0.09 0.06 0.07 0.19 0.07 0.09 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 0.19039 -0.04773 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -1.470 -1.671 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 0.39785 -0.09621 > postscript(file="/var/www/html/rcomp/tmp/1lw511264529268.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/2n44s1264529268.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/3pa871264529268.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/45hjg1264529268.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/5bjdt1264529268.tab") > > try(system("convert tmp/1lw511264529268.ps tmp/1lw511264529268.png",intern=TRUE)) character(0) > try(system("convert tmp/2n44s1264529268.ps tmp/2n44s1264529268.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.534 0.285 1.015