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(100.01,103.84,104.48,95.43,104.80,108.64,105.65,108.42,115.35,113.64,115.24,100.33,101.29,104.48,99.26,100.11,103.52,101.18,96.39,97.56,96.39,85.10,79.77,79.13,80.84,82.75,92.55,96.60,96.92,95.32,98.52,100.22,104.91,103.10,97.13,103.42,111.72,118.11,111.62,100.22,102.03,105.76,107.68,110.77,105.44,112.26,114.07,117.90,124.72,126.42,134.73,135.79,143.36,140.37,144.74,151.98,150.92,163.38,154.43,146.66,157.95,162.10,180.42,179.57,171.58,185.43,190.64,203.00,202.36,193.41,186.17,192.24,209.60,206.41,209.82,230.37,235.80,232.07,244.64,242.19,217.48,209.39,211.73,221.00,203.11,214.71,224.19,238.04,238.36,246.24,259.87,249.97,266.48,282.98,306.31,301.73,314.62,332.62,355.51,370.32,408.13,433.58,440.51,386.29,342.84,254.97,203.42,170.09,174.03,167.85,177.01,188.19,211.20,240.91,230.26,251.25,241.66) > 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] 117 > (np <- floor(n / par1)) [1] 9 > 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] [1,] 100.01 101.29 80.84 111.72 124.72 157.95 209.60 203.11 314.62 [2,] 103.84 104.48 82.75 118.11 126.42 162.10 206.41 214.71 332.62 [3,] 104.48 99.26 92.55 111.62 134.73 180.42 209.82 224.19 355.51 [4,] 95.43 100.11 96.60 100.22 135.79 179.57 230.37 238.04 370.32 [5,] 104.80 103.52 96.92 102.03 143.36 171.58 235.80 238.36 408.13 [6,] 108.64 101.18 95.32 105.76 140.37 185.43 232.07 246.24 433.58 [7,] 105.65 96.39 98.52 107.68 144.74 190.64 244.64 259.87 440.51 [8,] 108.42 97.56 100.22 110.77 151.98 203.00 242.19 249.97 386.29 [9,] 115.35 96.39 104.91 105.44 150.92 202.36 217.48 266.48 342.84 [10,] 113.64 85.10 103.10 112.26 163.38 193.41 209.39 282.98 254.97 [11,] 115.24 79.77 97.13 114.07 154.43 186.17 211.73 306.31 203.42 [12,] 100.33 79.13 103.42 117.90 146.66 192.24 221.00 301.73 170.09 > 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] 106.31917 95.34833 96.02333 109.79833 143.12500 183.73917 222.54167 [8] 252.66583 334.40833 > arr.sd [1] 6.260015 8.920144 7.563327 5.711752 11.449772 14.300262 13.848737 [8] 32.503285 86.281189 > arr.range [1] 19.92 25.35 24.07 17.89 38.66 45.05 38.23 103.20 270.42 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -25.7005 0.2708 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -6.044 1.714 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -80.6167 0.8474 > postscript(file="/var/www/html/rcomp/tmp/10wgd1259952532.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/2gsw21259952532.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/30jk01259952532.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/4iuvq1259952532.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/5ruh71259952532.tab") > system("convert tmp/10wgd1259952532.ps tmp/10wgd1259952532.png") > system("convert tmp/2gsw21259952532.ps tmp/2gsw21259952532.png") > > > proc.time() user system elapsed 0.498 0.291 0.839