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(23.98,24.24,24.92,25.46,25.84,26.08,26.18,26.34,26.42,26.38,26.04,25.58,25.65,25.56,25.62,25.62,25.69,25.68,25.68,25.83,25.93,26.11,24.72,24.62,24.65,25.24,25.56,25.9,25.87,25.78,25.78,25.74,25.78,25.73,24.67,24.31,24.56,25,25.38,25.99,26.22,26.19,26.22,26.22,26.61,26.72,25.46,25.48,25.59,25.88,26,26.97,27.2,27.19,27.19,27.19,27.26,26.9,26.11,25.87,26.02,26.31,26.37,26.52,26.86,26.92,26.98,26.98,27.03,26.75,26.39,26.3,26.3,26.52,26.53,26.98,27.22,27.34,27.41,27.47,27.46,27.53,27.21,26.91,26.95,26.91,27.39,27.62,27.79,27.88,27.9,28.09,28.46,28.73,27.93,27.61,27.65,28.19,28.98,28.99,29.02,29,29.04,29.19,29.23,29.26,29.02,28.47,28.53,28.48,28.68,28.89,29.2,29.21,29.15,29.22,29.34,29.13,28.84,28.76) > par1 = '12' > #'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] 120 > (np <- floor(n / par1)) [1] 10 > 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] [1,] 23.98 25.65 24.65 24.56 25.59 26.02 26.30 26.95 27.65 28.53 [2,] 24.24 25.56 25.24 25.00 25.88 26.31 26.52 26.91 28.19 28.48 [3,] 24.92 25.62 25.56 25.38 26.00 26.37 26.53 27.39 28.98 28.68 [4,] 25.46 25.62 25.90 25.99 26.97 26.52 26.98 27.62 28.99 28.89 [5,] 25.84 25.69 25.87 26.22 27.20 26.86 27.22 27.79 29.02 29.20 [6,] 26.08 25.68 25.78 26.19 27.19 26.92 27.34 27.88 29.00 29.21 [7,] 26.18 25.68 25.78 26.22 27.19 26.98 27.41 27.90 29.04 29.15 [8,] 26.34 25.83 25.74 26.22 27.19 26.98 27.47 28.09 29.19 29.22 [9,] 26.42 25.93 25.78 26.61 27.26 27.03 27.46 28.46 29.23 29.34 [10,] 26.38 26.11 25.73 26.72 26.90 26.75 27.53 28.73 29.26 29.13 [11,] 26.04 24.72 24.67 25.46 26.11 26.39 27.21 27.93 29.02 28.84 [12,] 25.58 24.62 24.31 25.48 25.87 26.30 26.91 27.61 28.47 28.76 > 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] 25.62167 25.55917 25.41750 25.83750 26.61250 26.61917 27.07333 27.77167 [9] 28.83667 28.95250 > arr.sd [1] 0.8310545 0.4433849 0.5608131 0.6588575 0.6561891 0.3405466 0.4237137 [8] 0.5359415 0.4860665 0.2937880 > arr.range [1] 2.44 1.49 1.59 2.16 1.67 1.01 1.23 1.82 1.61 0.86 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 2.27865 -0.06543 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 10.933 -3.535 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 6.2950 -0.1754 > postscript(file="/var/www/html/rcomp/tmp/1myvb1262782272.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/2o0me1262782272.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/3iiim1262782272.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/4rgjy1262782272.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/5wss71262782272.tab") > > try(system("convert tmp/1myvb1262782272.ps tmp/1myvb1262782272.png",intern=TRUE)) character(0) > try(system("convert tmp/2o0me1262782272.ps tmp/2o0me1262782272.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.530 0.296 0.710