R version 2.6.0 (2007-10-03) Copyright (C) 2007 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(102.61,102.18,101.64,102,102.18,101.89,102.09,101.6,101.33,101.44,101.49,100.41,101.38,101.4,102.16,104.46,104.75,104.2,106.05,107.54,108.23,108.99,109.51,111.99,111.08,112.95,115.49,114.67,116.85,119.57,119.41,118.46,122.81,121.76,121.37,118.61,116.08,117.84,117.02,119.78,122.58,120.98,118.92,117.81,119.73,117.16,116.03,115.55,115.36,116.09,117.32,120.45,119.86,118.51,118.92,119.11,120.34,121.23,119.43,119.28,120.64,122.24,123.1,120.72,118.34,118.8,119.29,121.47,122.35,121.53,121.72,121.58,121.55,122.02,123.74,125.8,129.29,128.89,130.04,131.57,131.97,134.43,132.63,130.26,129,131.65,134.21,138.63,138.1,140.51,144.36,145.57,148.7,147.86,143.16,141.96) > 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] 96 > (np <- floor(n / par1)) [1] 8 > 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] [1,] 102.61 101.38 111.08 116.08 115.36 120.64 121.55 129.00 [2,] 102.18 101.40 112.95 117.84 116.09 122.24 122.02 131.65 [3,] 101.64 102.16 115.49 117.02 117.32 123.10 123.74 134.21 [4,] 102.00 104.46 114.67 119.78 120.45 120.72 125.80 138.63 [5,] 102.18 104.75 116.85 122.58 119.86 118.34 129.29 138.10 [6,] 101.89 104.20 119.57 120.98 118.51 118.80 128.89 140.51 [7,] 102.09 106.05 119.41 118.92 118.92 119.29 130.04 144.36 [8,] 101.60 107.54 118.46 117.81 119.11 121.47 131.57 145.57 [9,] 101.33 108.23 122.81 119.73 120.34 122.35 131.97 148.70 [10,] 101.44 108.99 121.76 117.16 121.23 121.53 134.43 147.86 [11,] 101.49 109.51 121.37 116.03 119.43 121.72 132.63 143.16 [12,] 100.41 111.99 118.61 115.55 119.28 121.58 130.26 141.96 > 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] 101.7383 105.8883 117.7525 118.2900 118.8250 120.9817 128.5158 140.3092 > arr.sd [1] 0.5621199 3.4213470 3.6310858 2.1564449 1.7659687 1.4823313 4.2658314 [8] 6.2535655 > arr.range [1] 1.23 10.59 21.17 20.58 19.05 21.21 32.34 47.10 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -10.4684 0.1127 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -24.277 5.266 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -111.605 1.120 > postscript(file="/var/www/html/rcomp/tmp/13ahj1195985393.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/2eka41195985393.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 > 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/3prsr1195985393.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/4tcha1195985393.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/5cdzf1195985393.tab") > > system("convert tmp/13ahj1195985393.ps tmp/13ahj1195985393.png") > system("convert tmp/2eka41195985393.ps tmp/2eka41195985393.png") > > > proc.time() user system elapsed 0.803 0.316 0.952