R version 2.10.1 (2009-12-14) 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(505.7,55.7,735.7,575.9,545.8,905.8,765.8,945.7,15.7,645.7,155.9,416,825.8,725.9,925.9,556,116.1,876.3,336.2,186.1,286.1,26,915.8,405.7,965.7,395.6,425.8,545.6,65.6,445.6,895.5,175.4,715.4,865.5,57.4,145.4,315.3,635.4,5.2,515.2,515.1,955,955,634.9,205,275,425,84.9,534.7,4.8,704.7,684.7,884.6,994.6,294.7,524.7,914.5,564.4,984.5,934.4,514.6,474.5,784.4,504.5,824.4,414.6,964.7,64.6,244.7,344.7,34.7,685,425,484.8,785.1,704.9,245.4,285.6,218.8,706.1,856.2,456.6,606.8,527.3,657.8,948.2,486.6,238.9,289.4,969.5,589.5,189.7,639.8,9710.1,969.9,939.9,859.7,679.9,879.9,329.8,349.6,39.5,849.5,449.6,749.6,249.7,649.8,619.4,939,778.9) > 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] 110 > (np <- floor(n / par1)) [1] 27 > 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,] 505.7 545.8 15.7 825.8 116.1 286.1 965.7 65.6 715.4 315.3 515.1 205.0 [2,] 55.7 905.8 645.7 725.9 876.3 26.0 395.6 445.6 865.5 635.4 955.0 275.0 [3,] 735.7 765.8 155.9 925.9 336.2 915.8 425.8 895.5 57.4 5.2 955.0 425.0 [4,] 575.9 945.7 416.0 556.0 186.1 405.7 545.6 175.4 145.4 515.2 634.9 84.9 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 534.7 884.6 914.5 514.6 824.4 244.7 425.0 245.4 856.2 657.8 289.4 639.8 [2,] 4.8 994.6 564.4 474.5 414.6 344.7 484.8 285.6 456.6 948.2 969.5 9710.1 [3,] 704.7 294.7 984.5 784.4 964.7 34.7 785.1 218.8 606.8 486.6 589.5 969.9 [4,] 684.7 524.7 934.4 504.5 64.6 685.0 704.9 706.1 527.3 238.9 189.7 939.9 [,25] [,26] [,27] [1,] 859.7 349.6 749.6 [2,] 679.9 39.5 249.7 [3,] 879.9 849.5 649.8 [4,] 329.8 449.6 619.4 > 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] 468.250 790.775 308.325 758.400 378.675 408.400 583.175 395.525 [9] 445.925 367.775 765.000 247.475 482.225 674.650 849.450 569.500 [17] 567.075 327.275 599.950 363.975 611.725 582.875 509.525 3064.925 [25] 687.325 422.050 567.125 > arr.sd [1] 291.3864 180.6184 279.4510 157.7139 344.2216 373.5635 263.1150 [8] 369.5890 404.1150 275.4218 224.7784 142.0182 327.2000 323.1584 [15] 192.3019 144.2752 408.2693 271.2253 172.3969 229.7303 174.1490 [22] 298.1408 350.5786 4432.6231 254.7401 334.1985 218.8025 > arr.range [1] 680.0 399.9 630.0 369.9 760.2 889.8 570.1 829.9 808.1 630.2 [11] 439.9 340.1 699.9 699.9 420.1 309.9 900.1 650.3 360.1 487.3 [21] 399.6 709.3 779.8 9070.3 550.1 810.0 499.9 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -489.984 1.469 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 0.8839 0.7585 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -938.158 2.978 > postscript(file="/var/yougetitorg/rcomp/tmp/1h6hj1306579019.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/yougetitorg/rcomp/tmp/2h9v31306579019.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/yougetitorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/yougetitorg/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/yougetitorg/rcomp/tmp/3g9n71306579019.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/yougetitorg/rcomp/tmp/41hde1306579019.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/yougetitorg/rcomp/tmp/586w61306579019.tab") > > try(system("convert tmp/1h6hj1306579019.ps tmp/1h6hj1306579019.png",intern=TRUE)) character(0) > try(system("convert tmp/2h9v31306579019.ps tmp/2h9v31306579019.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.600 0.330 0.824