R version 2.7.1 (2008-06-23) 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(100.58,118.48,79.58,81.97,127.13,120.76,120.26,74.9,67.59,87.73,102.87,144.94,110.48,96.34,100.43,90.88,128.28,101.21,73.76,73.64,66.4,57.34,113.59,123.53,102.87,102.99,95.8,98.43,102.65,129.55,100.37,101.93,101.94,93.87,100.91,92.64,101.67,88.67,129.86,98.07,166.45,176.52,82.07,92.18,95.02,84.69,103.01,107.9,204.13,101.99,119.23,95.65,160.95,111.06,150.41,94.79,160.34,104.08,101.07,111.5,136.9,141.71,153.98,134.27,124.71,72.89,101.2,73.28,174.05,111.9,97.06,105.23,109.13,84.04,118.82,90.84,144.28,110.16,86.09,59.87,108.97,94.93,87.36,143.52,108.7,121.13,210.25,110.2,161.46,99.41,132.72,174.29,69.93,83.43,127.53,187.58) > 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] 96 > (np <- floor(n / par1)) [1] 24 > 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] [1,] 100.58 127.13 67.59 110.48 128.28 66.40 102.87 102.65 101.94 101.67 [2,] 118.48 120.76 87.73 96.34 101.21 57.34 102.99 129.55 93.87 88.67 [3,] 79.58 120.26 102.87 100.43 73.76 113.59 95.80 100.37 100.91 129.86 [4,] 81.97 74.90 144.94 90.88 73.64 123.53 98.43 101.93 92.64 98.07 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 166.45 95.02 204.13 160.95 160.34 136.90 124.71 174.05 109.13 144.28 [2,] 176.52 84.69 101.99 111.06 104.08 141.71 72.89 111.90 84.04 110.16 [3,] 82.07 103.01 119.23 150.41 101.07 153.98 101.20 97.06 118.82 86.09 [4,] 92.18 107.90 95.65 94.79 111.50 134.27 73.28 105.23 90.84 59.87 [,21] [,22] [,23] [,24] [1,] 108.97 108.70 161.46 69.93 [2,] 94.93 121.13 99.41 83.43 [3,] 87.36 210.25 132.72 127.53 [4,] 143.52 110.20 174.29 187.58 > 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] 95.1525 110.7625 100.7825 99.5325 94.2225 90.2150 100.0225 108.6250 [9] 97.3400 104.5675 129.3050 97.6550 130.2500 129.3025 119.2475 141.7150 [17] 93.0200 122.0600 100.7075 100.1000 108.6950 137.5700 141.9700 117.1175 > arr.sd [1] 18.165086 24.112006 32.794066 8.280722 26.147605 33.187345 3.525142 [8] 13.982421 4.762205 17.729957 49.052414 10.143479 50.250978 31.469521 [15] 27.743419 8.737706 24.940282 35.187283 16.064187 35.906401 24.883152 [22] 48.769013 33.273406 53.024811 > arr.range [1] 38.90 52.23 77.35 19.60 54.64 66.19 7.19 29.18 9.30 41.19 [11] 94.45 23.21 108.48 66.16 59.27 19.71 51.82 76.99 34.78 84.41 [21] 56.16 101.55 74.88 117.65 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -19.1749 0.4091 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -6.077 1.944 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -37.8535 0.8516 > postscript(file="/var/www/html/rcomp/tmp/1hz7n1219065137.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/2v8v21219065137.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/32al71219065138.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/435mp1219065138.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/520v91219065138.tab") > > system("convert tmp/1hz7n1219065137.ps tmp/1hz7n1219065137.png") > system("convert tmp/2v8v21219065137.ps tmp/2v8v21219065137.png") > > > proc.time() user system elapsed 0.743 0.297 0.956