R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(2.4,2.4,2.5,2.6,2.4,2.6,2.4,2.3,2.4,2.4,2.4,2.4,2.4,2.4,2.4,2.4,2.5,2.1,2.1,2,2,2,1.9,1.9,2,1.8,1.6,1.3,1.4,1.4,1.5,1.7,1.6,1.5,1.6,1.5,1.1,1.1,1.1,1.4,1.3,1.4,1.3,1.1,1,0.9,0.8,0.8,0.8,0.8,1,1.1,1,0.9,1.1,1.2,1.2,1.4,1.5,1.7,1.9,1.9,1.9,1.7,1.7,2.1,2,2,2.5,2.4,2.5,2.5,2,1.9,2.2,2.7,3.1,2.8,2.6,2.3,2.2,2.2,2,2,2.6,2.5,2.5,2.3,2,1.9,2,2.1,2.1,2.3,2.3,2.3,2.1,2.4,2.5,2.1,1.8,1.9,1.9,2.1,2.2,2,2.2,2,1.9,1.6,1.7,2,2.5,2.4,2.3,2.3,2.1,2.4,2.2,2.4,1.9,2.1,2.1,2.1,2,2.1,2.2,2.2,2.6,2.5,2.3,2.2,2.4,2.3,2.2,2.5,2.5,2.5,2.4,2.3,1.7,1.6,1.9,1.9,1.8,1.8,1.9,1.9,1.9,1.9,1.8,1.7,2.1,2.6,3.1,3.1,3.2,3.3,3.6,3.3,3.7,4,4,3.8,3.6,3.2,2.1,1.6,1.1,1.2,0.6,0.6,0,-0.1,-0.6,-0.2,-0.3,-0.1,0.5,0.9) > 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] 180 > (np <- floor(n / par1)) [1] 15 > 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,] 2.4 2.4 2.0 1.1 0.8 1.9 2.0 2.6 2.1 1.9 1.9 2.4 1.8 [2,] 2.4 2.4 1.8 1.1 0.8 1.9 1.9 2.5 2.4 1.6 2.1 2.3 1.8 [3,] 2.5 2.4 1.6 1.1 1.0 1.9 2.2 2.5 2.5 1.7 2.1 2.2 1.9 [4,] 2.6 2.4 1.3 1.4 1.1 1.7 2.7 2.3 2.1 2.0 2.1 2.5 1.9 [5,] 2.4 2.5 1.4 1.3 1.0 1.7 3.1 2.0 1.8 2.5 2.0 2.5 1.9 [6,] 2.6 2.1 1.4 1.4 0.9 2.1 2.8 1.9 1.9 2.4 2.1 2.5 1.9 [7,] 2.4 2.1 1.5 1.3 1.1 2.0 2.6 2.0 1.9 2.3 2.2 2.4 1.8 [8,] 2.3 2.0 1.7 1.1 1.2 2.0 2.3 2.1 2.1 2.3 2.2 2.3 1.7 [9,] 2.4 2.0 1.6 1.0 1.2 2.5 2.2 2.1 2.2 2.1 2.6 1.7 2.1 [10,] 2.4 2.0 1.5 0.9 1.4 2.4 2.2 2.3 2.0 2.4 2.5 1.6 2.6 [11,] 2.4 1.9 1.6 0.8 1.5 2.5 2.0 2.3 2.2 2.2 2.3 1.9 3.1 [12,] 2.4 1.9 1.5 0.8 1.7 2.5 2.0 2.3 2.0 2.4 2.2 1.9 3.1 [,14] [,15] [1,] 3.2 1.1 [2,] 3.3 1.2 [3,] 3.6 0.6 [4,] 3.3 0.6 [5,] 3.7 0.0 [6,] 4.0 -0.1 [7,] 4.0 -0.6 [8,] 3.8 -0.2 [9,] 3.6 -0.3 [10,] 3.2 -0.1 [11,] 2.1 0.5 [12,] 1.6 0.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] 2.433333 2.175000 1.575000 1.108333 1.141667 2.091667 2.333333 2.241667 [9] 2.100000 2.150000 2.191667 2.183333 2.133333 3.283333 0.300000 > arr.sd [1] 0.08876254 0.22613351 0.19128750 0.21087839 0.27784343 0.30587678 [7] 0.37979261 0.22343733 0.20449494 0.29387691 0.19752253 0.32427074 [13] 0.50692179 0.73340220 0.59237580 > arr.range [1] 0.3 0.6 0.7 0.6 0.9 0.8 1.2 0.7 0.7 0.9 0.7 0.9 1.4 2.4 1.8 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 0.28235 0.01772 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -1.1601 -0.2012 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 0.82005 0.07809 > postscript(file="/var/wessaorg/rcomp/tmp/1i7361323208178.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/wessaorg/rcomp/tmp/2ou0e1323208178.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/3csjt1323208178.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/wessaorg/rcomp/tmp/42vd01323208178.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/wessaorg/rcomp/tmp/5yhr41323208178.tab") > > try(system("convert tmp/1i7361323208178.ps tmp/1i7361323208178.png",intern=TRUE)) character(0) > try(system("convert tmp/2ou0e1323208178.ps tmp/2ou0e1323208178.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.609 0.102 0.712