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(14.36 + ,14.62 + ,13.51 + ,14.95 + ,16.72 + ,16.33 + ,15.21 + ,16.69 + ,15.81 + ,16.02 + ,16.7 + ,15.99 + ,17.68 + ,18.89 + ,18.72 + ,21.14 + ,20.97 + ,23.75 + ,23.05 + ,23.45 + ,21.74 + ,19.37 + ,21.1 + ,21.2 + ,22.67 + ,22.24 + ,23.78 + ,23.27 + ,25.74 + ,26.1 + ,27.49 + ,31.41 + ,28.79 + ,26.76 + ,26.41 + ,27.05 + ,29.43 + ,32.1 + ,36.84 + ,34.22 + ,36.53 + ,40.99 + ,45.97 + ,43.6 + ,47.84 + ,51.47 + ,51.31 + ,48.47 + ,48.28 + ,46.56 + ,43.83 + ,51.17 + ,49.59 + ,49.11 + ,49.97 + ,50.07 + ,53.3 + ,57.08 + ,68.54 + ,71.62 + ,67.64 + ,64.79 + ,80.97 + ,88.42 + ,110.22 + ,99 + ,95.95 + ,107.94 + ,97.82 + ,111.64 + ,114.73 + ,117.58 + ,99.19 + ,90.19 + ,59.74 + ,44.51 + ,23.94 + ,21.29 + ,20.77 + ,25.07 + ,32.95 + ,40.05 + ,44.59 + ,40.28 + ,41.19 + ,38.14 + ,41.85 + ,43.76 + ,50.16 + ,52.94 + ,47.69 + ,51.52 + ,58.69 + ,50.44 + ,45.72 + ,43.24 + ,51.49 + ,50.43 + ,58.73 + ,65.12 + ,64.13 + ,54.64 + ,52.39 + ,52.51 + ,52.92 + ,55.22 + ,55.41 + ,57.02 + ,58.55 + ,57.49 + ,55.52 + ,57.84 + ,58.69 + ,59.74 + ,60.7 + ,60.74 + ,64.32 + ,66.9 + ,70.93 + ,75.89 + ,80.6 + ,81.39 + ,81.33 + ,77.04 + ,79.54 + ,81.93 + ,80.79 + ,81.98 + ,85.94 + ,86.6 + ,87.42 + ,93.14 + ,95.76 + ,99.75 + ,97.71 + ,94.99 + ,96.41 + ,96.28 + ,100.14 + ,99.9 + ,102.87 + ,107.37 + ,115.68 + ,124.33 + ,128.44 + ,130.19 + ,148.4 + ,169.14 + ,153.98 + ,163.13 + ,165.4 + ,166.35 + ,173.73 + ,174.23 + ,177.04 + ,170.78 + ,174.01 + ,183.76 + ,201.95 + ,205.38 + ,197.36 + ,196.53 + ,179.94 + ,174.84 + ,179.86 + ,172.77 + ,162.56 + ,178.4 + ,190.83 + ,201.07 + ,198.95 + ,190.46 + ,186.27 + ,187.96 + ,174.99 + ,164.1 + ,131.48 + ,116.14 + ,103.43 + ,96.87 + ,93.68 + ,96.49 + ,105.22 + ,110.11 + ,118.47 + ,122.15 + ,137.35 + ,134.83 + ,138.34 + ,141.98 + ,149.45 + ,154.68 + ,145.98 + ,156.33 + ,176.28 + ,159.08 + ,151.18 + ,162.63 + ,174.2 + ,180.51 + ,185.31 + ,186.33) > par1 = '12' > par1 <- as.numeric(par1) > (n <- length(x)) [1] 202 > (np <- floor(n / par1)) [1] 16 > 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] [1,] 14.36 17.68 22.67 29.43 48.28 67.64 99.19 41.19 51.49 58.55 80.60 95.76 [2,] 14.62 18.89 22.24 32.10 46.56 64.79 90.19 38.14 50.43 57.49 81.39 99.75 [3,] 13.51 18.72 23.78 36.84 43.83 80.97 59.74 41.85 58.73 55.52 81.33 97.71 [4,] 14.95 21.14 23.27 34.22 51.17 88.42 44.51 43.76 65.12 57.84 77.04 94.99 [5,] 16.72 20.97 25.74 36.53 49.59 110.22 23.94 50.16 64.13 58.69 79.54 96.41 [6,] 16.33 23.75 26.10 40.99 49.11 99.00 21.29 52.94 54.64 59.74 81.93 96.28 [7,] 15.21 23.05 27.49 45.97 49.97 95.95 20.77 47.69 52.39 60.70 80.79 100.14 [8,] 16.69 23.45 31.41 43.60 50.07 107.94 25.07 51.52 52.51 60.74 81.98 99.90 [9,] 15.81 21.74 28.79 47.84 53.30 97.82 32.95 58.69 52.92 64.32 85.94 102.87 [10,] 16.02 19.37 26.76 51.47 57.08 111.64 40.05 50.44 55.22 66.90 86.60 107.37 [11,] 16.70 21.10 26.41 51.31 68.54 114.73 44.59 45.72 55.41 70.93 87.42 115.68 [12,] 15.99 21.20 27.05 48.47 71.62 117.58 40.28 43.24 57.02 75.89 93.14 124.33 [,13] [,14] [,15] [,16] [1,] 128.44 174.01 190.83 93.68 [2,] 130.19 183.76 201.07 96.49 [3,] 148.40 201.95 198.95 105.22 [4,] 169.14 205.38 190.46 110.11 [5,] 153.98 197.36 186.27 118.47 [6,] 163.13 196.53 187.96 122.15 [7,] 165.40 179.94 174.99 137.35 [8,] 166.35 174.84 164.10 134.83 [9,] 173.73 179.86 131.48 138.34 [10,] 174.23 172.77 116.14 141.98 [11,] 177.04 162.56 103.43 149.45 [12,] 170.78 178.40 96.87 154.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] 15.57583 20.92167 25.97583 41.56417 53.26000 96.39167 45.21417 [8] 47.11167 55.83417 62.27583 83.14167 102.59917 160.06750 183.94667 [15] 161.87917 125.22917 > arr.sd [1] 1.044104 1.945666 2.676478 7.642435 8.527160 17.781696 25.898028 [8] 5.874193 4.731945 6.120281 4.363301 9.017344 16.557916 13.311978 [15] 38.935622 20.562518 > arr.range [1] 3.21 6.07 9.17 22.04 27.79 52.79 78.42 20.55 14.69 20.37 [11] 16.10 29.34 48.60 42.82 104.20 61.00 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 1.8869 0.1208 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -2.350 1.062 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 7.8077 0.3374 > postscript(file="/var/www/html/rcomp/tmp/1sh6y1293200673.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/html/rcomp/tmp/2sh6y1293200673.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/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/3wz541293200673.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/4zila1293200673.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/531kg1293200673.tab") > > try(system("convert tmp/1sh6y1293200673.ps tmp/1sh6y1293200673.png",intern=TRUE)) character(0) > try(system("convert tmp/2sh6y1293200673.ps tmp/2sh6y1293200673.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.513 0.290 1.507