R version 2.6.2 (2008-02-08) Copyright (C) 2008 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(42.3,50.8,54.1,38.2,48.4,61.1,54.1,61.4,64.3,57.4,71.7,55.3,55.1,66.8,59.4,64.9,59.2,77.4,75.8,38.3,54,61.8,61.3,104.3,39.7,62.6,50.2,90.9,56.2,50.2,52.8,45.6,69,81.9,73.9,54.9,55.4,64.6,49.6,55.8,44.6,61.5,40.5,48.3,50.9,65.3,56.5,53.2,56.9,79.5,94,68.4,65.9,85.5,77.5,114.8,87.4,107.5,151.7,94.4,67.5,95.2,96.2,70.6,80.1,83.4,115.4,61.5,80.6,94.3,82.6,107.7,79.1,102.8,125.2,106.4,62.3,107.4,67.9,88,76.5,130.5,100.9,85.6) > 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] 84 > (np <- floor(n / par1)) [1] 21 > 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,] 42.3 48.4 64.3 55.1 59.2 54.0 39.7 56.2 69.0 55.4 44.6 50.9 56.9 [2,] 50.8 61.1 57.4 66.8 77.4 61.8 62.6 50.2 81.9 64.6 61.5 65.3 79.5 [3,] 54.1 54.1 71.7 59.4 75.8 61.3 50.2 52.8 73.9 49.6 40.5 56.5 94.0 [4,] 38.2 61.4 55.3 64.9 38.3 104.3 90.9 45.6 54.9 55.8 48.3 53.2 68.4 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] 65.9 87.4 67.5 80.1 80.6 79.1 62.3 76.5 [2,] 85.5 107.5 95.2 83.4 94.3 102.8 107.4 130.5 [3,] 77.5 151.7 96.2 115.4 82.6 125.2 67.9 100.9 [4,] 114.8 94.4 70.6 61.5 107.7 106.4 88.0 85.6 > 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] 46.350 56.250 62.175 61.550 62.675 70.350 60.850 51.200 69.925 [10] 56.350 48.725 56.475 74.700 85.925 110.250 82.375 85.100 91.300 [19] 103.375 81.400 98.375 > arr.sd [1] 7.364102 6.226021 7.423106 5.323220 18.214532 22.912369 22.111912 [8] 4.469154 11.340304 6.186814 9.092992 6.316315 15.833088 20.864064 [15] 28.861797 15.443742 22.382583 12.491864 18.930465 20.547668 23.665076 > arr.range [1] 15.9 13.0 16.4 11.7 39.1 50.3 51.2 10.6 27.0 15.0 21.0 14.4 37.1 48.9 64.3 [16] 28.7 53.9 27.1 46.1 45.1 54.0 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -7.444 0.305 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -4.976 1.766 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -17.5352 0.6987 > postscript(file="/var/www/html/rcomp/tmp/1vjin1211751730.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/2lfvj1211751730.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/3ucz81211751730.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/4hsm51211751730.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/5ffq01211751730.tab") > > system("convert tmp/1vjin1211751730.ps tmp/1vjin1211751730.png") > system("convert tmp/2lfvj1211751730.ps tmp/2lfvj1211751730.png") > > > proc.time() user system elapsed 0.729 0.289 3.094