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(75.9,76.9,77.9,78.9,79.9,80.9,81.9,82.9,83.9,84.9,85.9,86.9,87.9,88.9,89.9,90.9,91.9,92.9,93.9,94.9,95.9,96.9,97.9,98.9,99.9,100.9,101.9,102.9,103.9,104.9,105.9,106.9,107.9,108.9,109.9,110.9,111.9,112.9,113.9,114.9,115.9,116.9,117.9,118.9,119.9,120.9,121.9,122.9,123.9,124.9,125.9,126.9,127.9,128.9,129.9,130.9,131.9,132.9,133.9,134.9,135.9,136.9,137.9,138.9,139.9,140.9,141.9,142.9,143.9,144.9,145.9,146.9,147.9,148.9,149.9,150.9,151.9,152.9,153.9,154.9,155.9,156.9,157.9,158.9,159.9,160.9,161.9,162.9,163.9,164.9,165.9,166.9,167.9,168.9,169.9,170.9,171.9,172.9,173.9,174.9,175.9,176.9,177.9,178.9,179.9,180.9,181.9,182.9) > 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] [1,] 75.9 79.9 83.9 87.9 91.9 95.9 99.9 103.9 107.9 111.9 115.9 119.9 123.9 [2,] 76.9 80.9 84.9 88.9 92.9 96.9 100.9 104.9 108.9 112.9 116.9 120.9 124.9 [3,] 77.9 81.9 85.9 89.9 93.9 97.9 101.9 105.9 109.9 113.9 117.9 121.9 125.9 [4,] 78.9 82.9 86.9 90.9 94.9 98.9 102.9 106.9 110.9 114.9 118.9 122.9 126.9 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 127.9 131.9 135.9 139.9 143.9 147.9 151.9 155.9 159.9 163.9 167.9 171.9 [2,] 128.9 132.9 136.9 140.9 144.9 148.9 152.9 156.9 160.9 164.9 168.9 172.9 [3,] 129.9 133.9 137.9 141.9 145.9 149.9 153.9 157.9 161.9 165.9 169.9 173.9 [4,] 130.9 134.9 138.9 142.9 146.9 150.9 154.9 158.9 162.9 166.9 170.9 174.9 [,26] [,27] [1,] 175.9 179.9 [2,] 176.9 180.9 [3,] 177.9 181.9 [4,] 178.9 182.9 > 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] 77.4 81.4 85.4 89.4 93.4 97.4 101.4 105.4 109.4 113.4 117.4 121.4 [13] 125.4 129.4 133.4 137.4 141.4 145.4 149.4 153.4 157.4 161.4 165.4 169.4 [25] 173.4 177.4 181.4 > arr.sd [1] 1.290994 1.290994 1.290994 1.290994 1.290994 1.290994 1.290994 1.290994 [9] 1.290994 1.290994 1.290994 1.290994 1.290994 1.290994 1.290994 1.290994 [17] 1.290994 1.290994 1.290994 1.290994 1.290994 1.290994 1.290994 1.290994 [25] 1.290994 1.290994 1.290994 > arr.range [1] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 1.291e+00 -9.157e-18 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 2.554e-01 -8.168e-17 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 3.000e+00 -1.831e-17 > postscript(file="/var/www/html/rcomp/tmp/1jato1261081987.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/27zvi1261081987.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/3bt6h1261081987.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/4vijj1261081987.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/5hf9h1261081987.tab") > > try(system("convert tmp/1jato1261081987.ps tmp/1jato1261081987.png",intern=TRUE)) character(0) > try(system("convert tmp/27zvi1261081987.ps tmp/27zvi1261081987.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.541 0.282 0.618