R version 2.12.1 (2010-12-16) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) 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. Natural language support but running in an English locale 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(193.230,199.068,195.076,191.563,191.067,186.665,185.508,184.371,183.046,175.714,175.768,171.029,170.465,170.102,156.389,124.291,99.360,86.675,85.056,128.236,164.257,162.401,152.779,156.005,153.387,153.190,148.840,144.211,145.953,145.542,150.271,147.489,143.824,134.754,131.736,126.304,125.511,125.495,130.133,126.257,110.323,98.417,105.749,120.665,124.075,127.245,146.731,144.979,148.210,144.670,142.970,142.524,146.142,146.522,148.128,148.798,150.181,152.388,155.694,160.662,155.520,158.262,154.338,158.196,160.371,154.856,150.636,145.899,141.242,140.834,141.119,139.104,134.437,129.425,123.155,119.273,120.472,121.523,121.983,123.658,124.794,124.827,120.382,117.395,115.790,114.283,117.271,117.448,118.764,120.550,123.554,125.412,124.182,119.828,115.361,114.226,115.214,115.864,114.276,113.469) > 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] 100 > (np <- floor(n / par1)) [1] 25 > 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,] 193.230 191.067 183.046 170.465 99.360 164.257 153.387 145.953 143.824 [2,] 199.068 186.665 175.714 170.102 86.675 162.401 153.190 145.542 134.754 [3,] 195.076 185.508 175.768 156.389 85.056 152.779 148.840 150.271 131.736 [4,] 191.563 184.371 171.029 124.291 128.236 156.005 144.211 147.489 126.304 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 125.511 110.323 124.075 148.210 146.142 150.181 155.520 160.371 141.242 [2,] 125.495 98.417 127.245 144.670 146.522 152.388 158.262 154.856 140.834 [3,] 130.133 105.749 146.731 142.970 148.128 155.694 154.338 150.636 141.119 [4,] 126.257 120.665 144.979 142.524 148.798 160.662 158.196 145.899 139.104 [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 134.437 120.472 124.794 115.790 118.764 124.182 115.214 [2,] 129.425 121.523 124.827 114.283 120.550 119.828 115.864 [3,] 123.155 121.983 120.382 117.271 123.554 115.361 114.276 [4,] 119.273 123.658 117.395 117.448 125.412 114.226 113.469 > 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] 194.73425 186.90275 176.38925 155.31175 99.83175 158.86050 149.90700 [8] 147.31375 134.15450 126.84900 108.78850 135.75750 144.59350 147.39750 [15] 154.73125 156.57900 152.94050 140.57475 126.57250 121.90900 121.84950 [22] 116.19800 122.07000 118.39925 114.70575 > arr.sd [1] 3.225822 2.929880 4.962745 21.693470 19.987053 5.378844 4.338640 [8] 2.142178 7.333442 2.218008 9.313297 11.752974 2.582215 1.269883 [15] 4.556910 1.965599 6.158325 0.995280 6.706940 1.326454 3.630047 [22] 1.477331 2.978325 4.550769 1.051047 > arr.range [1] 7.505 6.696 12.017 46.174 43.180 11.478 9.176 4.729 17.520 4.638 [11] 22.248 22.656 5.686 2.656 10.481 3.924 14.472 2.138 15.164 3.186 [21] 7.432 3.165 6.648 9.956 2.395 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 10.45661 -0.03612 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 2.9414 -0.3285 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 22.60687 -0.07681 > postscript(file="/var/www/html/freestat/rcomp/tmp/1u2b21305849807.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/freestat/rcomp/tmp/2919f1305849807.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/33w4z1305849807.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/freestat/rcomp/tmp/4kszn1305849807.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/freestat/rcomp/tmp/5uovk1305849807.tab") > > try(system("convert tmp/1u2b21305849807.ps tmp/1u2b21305849807.png",intern=TRUE)) character(0) > try(system("convert tmp/2919f1305849807.ps tmp/2919f1305849807.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.766 0.078 0.842