R version 2.8.0 (2008-10-20) 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(77.7,78.89,90.2,77.26,80.76,84.93,66.08,71.56,80.78,83.31,85.3,73.94,78.7,81.32,86.8,80.76,84.46,84.21,73.64,70.85,83.78,89.12,78.93,80.54,81.67,82.53,88.2,89.17,83.7,89.79,77.58,70.11,88.07,92.49,83.33,90.05,82.91,88.52,96.42,90.87,86.4,97.47,85.67,79.91,95.73,94.6,91.92,90.38,82.31,87.82,101.29,89.58,87.83,99.95,82.67,84.65,97.83,97.47,97.66,99.14,90.02,100.97,112.48,91.44,108.46,98.41,89.35,92.8,100.43,104.85,108.36,101.54,105.26,101.8,112.36,99.5,104.65,101.13,89.8,87.84,96.41,103.26,100.31,92.33,96.19,96.37,103.06,101.5,101.88,100.85,95.56,87.6,101.18,110.8,101.1,104.42,103.27,100.87,107.8,104.99,100.76,104.46,100.62,87.84,107.31,115.61,103.43,109.93,104.43,106.69,123.1,109.42,101.46,124.48,101.49,100.46,115.51,113.37,115.4,118.2,106.82,110.17,119.91,112.31,110.62,120.37,97.94,103.02,116.36,108.51,122.54,121.32,112.25,109.89,129.58,107.2,118.68,118.25,102.67,104.19,117.74,123.3,122.2,112.71,118.53,115.32,127.36,110.45,122.22,123.39,116.2,109.22,116.98,132.89,125.24,115.68) > 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] 156 > (np <- floor(n / par1)) [1] 13 > 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] [1,] 77.70 78.70 81.67 82.91 82.31 90.02 105.26 96.19 103.27 104.43 106.82 [2,] 78.89 81.32 82.53 88.52 87.82 100.97 101.80 96.37 100.87 106.69 110.17 [3,] 90.20 86.80 88.20 96.42 101.29 112.48 112.36 103.06 107.80 123.10 119.91 [4,] 77.26 80.76 89.17 90.87 89.58 91.44 99.50 101.50 104.99 109.42 112.31 [5,] 80.76 84.46 83.70 86.40 87.83 108.46 104.65 101.88 100.76 101.46 110.62 [6,] 84.93 84.21 89.79 97.47 99.95 98.41 101.13 100.85 104.46 124.48 120.37 [7,] 66.08 73.64 77.58 85.67 82.67 89.35 89.80 95.56 100.62 101.49 97.94 [8,] 71.56 70.85 70.11 79.91 84.65 92.80 87.84 87.60 87.84 100.46 103.02 [9,] 80.78 83.78 88.07 95.73 97.83 100.43 96.41 101.18 107.31 115.51 116.36 [10,] 83.31 89.12 92.49 94.60 97.47 104.85 103.26 110.80 115.61 113.37 108.51 [11,] 85.30 78.93 83.33 91.92 97.66 108.36 100.31 101.10 103.43 115.40 122.54 [12,] 73.94 80.54 90.05 90.38 99.14 101.54 92.33 104.42 109.93 118.20 121.32 [,12] [,13] [1,] 112.25 118.53 [2,] 109.89 115.32 [3,] 129.58 127.36 [4,] 107.20 110.45 [5,] 118.68 122.22 [6,] 118.25 123.39 [7,] 102.67 116.20 [8,] 104.19 109.22 [9,] 117.74 116.98 [10,] 123.30 132.89 [11,] 122.20 125.24 [12,] 112.71 115.68 > 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] 79.22583 81.09250 84.72417 90.06667 92.35000 99.92583 99.55417 [8] 100.04250 103.90750 111.16750 112.49083 114.88833 119.45667 > arr.sd [1] 6.586062 5.192778 6.318261 5.572009 7.202568 7.774259 6.998621 5.687260 [9] 6.675358 8.430041 7.800836 8.165409 6.969768 > arr.range [1] 24.12 18.27 22.38 17.56 18.98 23.13 24.52 23.20 27.77 24.02 24.60 26.91 [13] 23.67 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 1.79976 0.05119 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -1.4756 0.7395 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 9.5227 0.1360 > postscript(file="/var/www/html/rcomp/tmp/123oz1229009408.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/2ery71229009408.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/3uohv1229009408.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/4swo21229009408.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/5uls81229009408.tab") > > system("convert tmp/123oz1229009408.ps tmp/123oz1229009408.png") > system("convert tmp/2ery71229009408.ps tmp/2ery71229009408.png") > > > proc.time() user system elapsed 0.537 0.307 0.634