R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(17,16.7,15.4,15.1,16.1,17,16.1,14.3,16.1,14.8,15.9,17.6,15.9,14.8,16.5,15.6,14.6,17.1,15.2,14.8,15.4,16.6,15.1,15.4,15.2,16.6,16.1,15.7,15.8,15.7,16.9,15.9,17.1,17,16.6,17.1,16.6,16.6,16.5,17,15.9,17,16.1,16.1,16.8,16.7,15.7,18.7,16.1,16.3,17.2,16.1,16.5,16.5,15.1,16.7,14.4,16.2,15.9,17.3,15.6,15.6,14.7,15.8,15.8,14.8,16.1,16.3,16.1,17.4,16.7,16.1,15.4,16.9,15.5,17.6,18.4,15.9,15.2,15.5,15.9,15.8,17.6,18.2,15.9,15.7,16.4,15.6,15.8,17,16.8,16.6,17.7,15.7,18,18.2,16.4,18,16.3) > 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] 99 > (np <- floor(n / par1)) [1] 24 > 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,] 17.0 16.1 16.1 15.9 14.6 15.4 15.2 15.8 17.1 16.6 15.9 16.8 16.1 16.5 [2,] 16.7 17.0 14.8 14.8 17.1 16.6 16.6 15.7 17.0 16.6 17.0 16.7 16.3 16.5 [3,] 15.4 16.1 15.9 16.5 15.2 15.1 16.1 16.9 16.6 16.5 16.1 15.7 17.2 15.1 [4,] 15.1 14.3 17.6 15.6 14.8 15.4 15.7 15.9 17.1 17.0 16.1 18.7 16.1 16.7 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 14.4 15.6 15.8 16.1 15.4 18.4 15.9 15.9 15.8 17.7 [2,] 16.2 15.6 14.8 17.4 16.9 15.9 15.8 15.7 17.0 15.7 [3,] 15.9 14.7 16.1 16.7 15.5 15.2 17.6 16.4 16.8 18.0 [4,] 17.3 15.8 16.3 16.1 17.6 15.5 18.2 15.6 16.6 18.2 > 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] 16.050 15.875 16.100 15.700 15.425 15.625 15.900 16.075 16.950 16.675 [11] 16.275 16.975 16.425 16.200 15.950 15.425 15.750 16.575 16.350 16.250 [21] 16.875 15.900 16.550 17.400 > arr.sd [1] 0.9398581 1.1324752 1.1518102 0.7071068 1.1441882 0.6652067 0.5944185 [8] 0.5560276 0.2380476 0.2217356 0.4924429 1.2526638 0.5251984 0.7393691 [15] 1.1958261 0.4924429 0.6658328 0.6184658 1.0785793 1.4617341 1.2093387 [22] 0.3559026 0.5259911 1.1518102 > arr.range [1] 1.9 2.7 2.8 1.7 2.5 1.5 1.4 1.2 0.5 0.5 1.1 3.0 1.1 1.6 2.9 1.1 1.5 1.3 2.2 [20] 3.2 2.4 0.8 1.2 2.5 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -0.01169 0.04983 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 1.6129 -0.7016 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 0.99949 0.04781 > postscript(file="/var/www/rcomp/tmp/1q7z81304893063.ps",horizontal=F,onefile=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/rcomp/tmp/2gkf31304893063.ps",horizontal=F,onefile=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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3aksi1304893063.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/rcomp/tmp/4kqy21304893063.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/rcomp/tmp/5s7hn1304893063.tab") > > try(system("convert tmp/1q7z81304893063.ps tmp/1q7z81304893063.png",intern=TRUE)) character(0) > try(system("convert tmp/2gkf31304893063.ps tmp/2gkf31304893063.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.640 0.360 0.973