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(90.6,91,90.7,91.3,91.5,91.2,91.2,91.5,92,91.7,91.7,92,91.5,91.7,92.1,92,91.8,91.4,91.3,91.5,92.3,92.7,92.1,92.3,92.3,92.5,92.3,92.7,93.4,93.1,93.8,94.6,94.5,94.4,94.2,93.5,93.1,93.1,93,93.5,93.5,92.9,92.8,92.3,91.8,91.3,90.6,90,89.7,89.6,90,90.9,91.2,91.3,92.2,92.7,93,93.2,94.1,95.1,95.1,96.6,97.8,97.7,99,99.3,100.4,101.2,103.1,104.3,103.7,102,100.5,101,101.3,101.3,101.3,100.8,100.7,100.6,101.1,100.7,100.6,100.5,101.5,101.5,101.5,102.1,102.1,102.2,102.4,102.5,102.6,102.8,102.8,103.1,102.5,102.9,103.6,104,103.5,103.1,102.4,102.2,102.4,102.6,102.8,102.8,103.6,104.7,105.5,106.6,107.2,107.5,108.3,108.7,108.8,109.8,109.5,109.2,110.6,110.1,109.9,109.7,109.4,109.4,109.4,109.5,109.5,109.9,110,110.8,112.4,112.8,113.7,114.5,114.8,115.6,115.8,115.8,116.3,116.3,116.8,116.7,116.8,117,117.2,117.1,117.3,117.4,117.7,117.9,118.8,119.9,122.4,123.5,125.6,127.4,128.9,129.5,130.8,132.7,134,132.9,133.1,131.7,128.8,125.1) > 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] 168 > (np <- floor(n / par1)) [1] 14 > 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] [1,] 90.6 91.5 92.3 93.1 89.7 95.1 100.5 101.5 102.5 103.6 110.6 112.4 116.8 [2,] 91.0 91.7 92.5 93.1 89.6 96.6 101.0 101.5 102.9 104.7 110.1 112.8 117.0 [3,] 90.7 92.1 92.3 93.0 90.0 97.8 101.3 101.5 103.6 105.5 109.9 113.7 117.2 [4,] 91.3 92.0 92.7 93.5 90.9 97.7 101.3 102.1 104.0 106.6 109.7 114.5 117.1 [5,] 91.5 91.8 93.4 93.5 91.2 99.0 101.3 102.1 103.5 107.2 109.4 114.8 117.3 [6,] 91.2 91.4 93.1 92.9 91.3 99.3 100.8 102.2 103.1 107.5 109.4 115.6 117.4 [7,] 91.2 91.3 93.8 92.8 92.2 100.4 100.7 102.4 102.4 108.3 109.4 115.8 117.7 [8,] 91.5 91.5 94.6 92.3 92.7 101.2 100.6 102.5 102.2 108.7 109.5 115.8 117.9 [9,] 92.0 92.3 94.5 91.8 93.0 103.1 101.1 102.6 102.4 108.8 109.5 116.3 118.8 [10,] 91.7 92.7 94.4 91.3 93.2 104.3 100.7 102.8 102.6 109.8 109.9 116.3 119.9 [11,] 91.7 92.1 94.2 90.6 94.1 103.7 100.6 102.8 102.8 109.5 110.0 116.8 122.4 [12,] 92.0 92.3 93.5 90.0 95.1 102.0 100.5 103.1 102.8 109.2 110.8 116.7 123.5 [,14] [1,] 125.6 [2,] 127.4 [3,] 128.9 [4,] 129.5 [5,] 130.8 [6,] 132.7 [7,] 134.0 [8,] 132.9 [9,] 133.1 [10,] 131.7 [11,] 128.8 [12,] 125.1 > 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] 91.36667 91.89167 93.44167 92.32500 91.91667 100.01667 100.86667 [8] 102.25833 102.90000 107.45000 109.85000 115.12500 118.58333 130.04167 > arr.sd [1] 0.4559373 0.4294994 0.8659817 1.1553236 1.7657516 2.9322140 0.3171846 [8] 0.5451577 0.5526794 1.9970433 0.4700097 1.4936989 2.2282620 2.9825122 > arr.range [1] 1.4 1.4 2.3 3.5 5.5 9.2 0.8 1.6 1.8 6.2 1.4 4.4 6.7 8.9 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -3.19507 0.04345 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -15.314 3.304 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -9.3368 0.1283 > postscript(file="/var/www/html/rcomp/tmp/1fpe21259919015.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/2wy5q1259919015.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/359wd1259919015.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/4j12z1259919015.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/5uopv1259919015.tab") > system("convert tmp/1fpe21259919015.ps tmp/1fpe21259919015.png") > system("convert tmp/2wy5q1259919015.ps tmp/2wy5q1259919015.png") > > > proc.time() user system elapsed 0.500 0.271 1.148