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(104.65,109.2,103.93,101.93,101.58,102.63,106.83,105.57,105,104.16,106.93,106.5,106.47,112.33,106.81,103.49,104.13,103.2,105.55,102.8,106.68,105.43,109.01,112.24,112.87,110.98,112.85,112.08,110.72,109.69,112.53,112.99,111.74,111.15,114.82,117.38,117.81,122.85,116.96,119.16,117.74,118.84,123.81,120.33,119.2,117.32,128.58,129.2,126.19,132.1,128.12,122.28,122.36,123.13,125.97,126.14,122.7,122.67,129.19,133.01,123.96,128.96,127.32,131.38,125.25,127.91,130.42,128.44,125.86,125.71,130.63,131.78,125.61,131.84,122.14,127.13,124.49,125.48,129.86,126.32,125.56,125.64,128.26,125.47,134.4,134.5,131.22,121.62,124.16,127.5,132.86,127.87,124.07,124.25,131.16,129.24,129.24,135.51,128.97,126.89,127.52,130.31,132.39,132.69,128.73,129.66,127.72,132.63,129.74,138.46,134.31,128.8,129.95,134.15,136.01,135.1,132.27,132.49,130.06,136.11,131.47,140.61,141.65,126.75,133.9,138.75,141.86,141.13,138.76,138.65,138.59,147.09,140.17,152.38,144.02,139.55,141.1,145.85,147.88,145.17) > 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] 140 > (np <- floor(n / par1)) [1] 35 > 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,] 104.65 101.58 105.00 106.47 104.13 106.68 112.87 110.72 111.74 117.81 [2,] 109.20 102.63 104.16 112.33 103.20 105.43 110.98 109.69 111.15 122.85 [3,] 103.93 106.83 106.93 106.81 105.55 109.01 112.85 112.53 114.82 116.96 [4,] 101.93 105.57 106.50 103.49 102.80 112.24 112.08 112.99 117.38 119.16 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 117.74 119.20 126.19 122.36 122.70 123.96 125.25 125.86 125.61 124.49 [2,] 118.84 117.32 132.10 123.13 122.67 128.96 127.91 125.71 131.84 125.48 [3,] 123.81 128.58 128.12 125.97 129.19 127.32 130.42 130.63 122.14 129.86 [4,] 120.33 129.20 122.28 126.14 133.01 131.38 128.44 131.78 127.13 126.32 [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [1,] 125.56 134.40 124.16 124.07 129.24 127.52 128.73 129.74 129.95 132.27 [2,] 125.64 134.50 127.50 124.25 135.51 130.31 129.66 138.46 134.15 132.49 [3,] 128.26 131.22 132.86 131.16 128.97 132.39 127.72 134.31 136.01 130.06 [4,] 125.47 121.62 127.87 129.24 126.89 132.69 132.63 128.80 135.10 136.11 [,31] [,32] [,33] [,34] [,35] [1,] 131.47 133.90 138.76 140.17 141.10 [2,] 140.61 138.75 138.65 152.38 145.85 [3,] 141.65 141.86 138.59 144.02 147.88 [4,] 126.75 141.13 147.09 139.55 145.17 > 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] 104.9275 104.1525 105.6475 107.2750 103.9200 108.3400 112.1950 111.4825 [9] 113.7725 119.1950 120.1800 123.5750 127.1725 124.4000 126.8925 127.9050 [17] 128.0050 128.4950 126.6800 126.5375 126.2325 130.4350 128.0975 127.1800 [25] 130.1525 130.7275 129.6850 132.8275 133.8025 132.7325 135.1200 138.9100 [33] 140.7725 144.0300 145.0000 > arr.sd [1] 3.071985 2.457239 1.291443 3.685263 1.221174 2.993471 0.889588 1.545345 [9] 2.893664 2.599596 2.642511 6.190215 4.085742 1.937954 5.102577 3.114156 [17] 2.130767 3.164854 4.024285 2.337868 1.353449 6.070857 3.586738 3.574959 [25] 3.722798 2.385908 2.117144 4.460055 2.678250 2.504827 7.214809 3.594282 [33] 4.212255 5.907413 2.843460 > arr.range [1] 7.27 5.25 2.77 8.84 2.75 6.81 1.89 3.30 6.23 5.89 6.07 11.88 [13] 9.82 3.78 10.34 7.42 5.17 6.07 9.70 5.37 2.79 12.88 8.70 7.09 [25] 8.62 5.17 4.91 9.66 6.06 6.05 14.90 7.96 8.50 12.83 6.78 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -4.23300 0.06009 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -11.126 2.531 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -8.5896 0.1263 > postscript(file="/var/www/html/rcomp/tmp/17vgn1261606063.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/2hb7k1261606063.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/3jqgh1261606063.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/43h621261606063.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/58nfm1261606063.tab") > > try(system("convert tmp/17vgn1261606063.ps tmp/17vgn1261606063.png",intern=TRUE)) character(0) > try(system("convert tmp/2hb7k1261606063.ps tmp/2hb7k1261606063.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.508 0.287 1.266