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(5221.3,5115.9,5107.4,5202.1,5307.5,5266.1,5329.8,5263.4,5177.1,5204.9,5185.2,5189.8,5253.8,5372.3,5478.4,5590.5,5699.8,5797.9,5854.3,5902.4,5956.9,6007.8,6101.7,6148.6,6207.4,6232,6291.7,6323.4,6365,6435,6493.4,6606.8,6639.1,6723.5,6759.4,6848.6,6918.1,6963.5,7013.1,7030.9,7112.1,7130.3,7130.8,7076.9,7040.8,7086.5,7120.7,7154.1,7228.2,7297.9,7369.5,7450.7,7459.7,7497.5,7536,7637.4,7715.1,7815.7,7859.5,7951.6,7973.7,7988,8053.1,8112,8169.2,8303.1,8372.7,8470.6,8536.1,8665.8,8773.7,8838.4,8936.2,8995.3,9098.9,9237.1,9315.5,9392.6,9502.2,9671.1,9695.6,9847.9,9836.6,9887.7,9875.6,9905.9,9871.1,9910,9977.3,10031.6,10090.7,10095.8,10126,10212.7,10398.7,10467,10543.6,10634.2,10728.7,10796.4,10875.8,10946.1,11050,11086.1,11217.3,11291.7,11314.1,11356.4,11357.8,11491.4,11625.7,11620.7) > 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] 112 > (np <- floor(n / par1)) [1] 28 > 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,] 5221.3 5307.5 5177.1 5253.8 5699.8 5956.9 6207.4 6365.0 6639.1 6918.1 [2,] 5115.9 5266.1 5204.9 5372.3 5797.9 6007.8 6232.0 6435.0 6723.5 6963.5 [3,] 5107.4 5329.8 5185.2 5478.4 5854.3 6101.7 6291.7 6493.4 6759.4 7013.1 [4,] 5202.1 5263.4 5189.8 5590.5 5902.4 6148.6 6323.4 6606.8 6848.6 7030.9 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 7112.1 7040.8 7228.2 7459.7 7715.1 7973.7 8169.2 8536.1 8936.2 9315.5 [2,] 7130.3 7086.5 7297.9 7497.5 7815.7 7988.0 8303.1 8665.8 8995.3 9392.6 [3,] 7130.8 7120.7 7369.5 7536.0 7859.5 8053.1 8372.7 8773.7 9098.9 9502.2 [4,] 7076.9 7154.1 7450.7 7637.4 7951.6 8112.0 8470.6 8838.4 9237.1 9671.1 [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [1,] 9695.6 9875.6 9977.3 10126.0 10543.6 10875.8 11217.3 11357.8 [2,] 9847.9 9905.9 10031.6 10212.7 10634.2 10946.1 11291.7 11491.4 [3,] 9836.6 9871.1 10090.7 10398.7 10728.7 11050.0 11314.1 11625.7 [4,] 9887.7 9910.0 10095.8 10467.0 10796.4 11086.1 11356.4 11620.7 > 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] 5161.675 5291.700 5189.250 5423.750 5813.600 6053.750 6263.625 [8] 6475.050 6742.650 6981.400 7112.525 7100.525 7336.575 7532.650 [15] 7835.475 8031.700 8328.900 8703.500 9066.875 9470.350 9816.950 [22] 9890.650 10048.850 10301.100 10675.725 10989.500 11294.875 11523.900 > arr.sd [1] 58.39648 32.44226 11.67975 144.13222 87.06101 87.15322 53.29993 [8] 102.32268 86.78573 50.93277 25.29326 48.44615 95.48031 76.46570 [15] 98.22323 63.71745 126.71104 132.37585 131.91043 154.20611 83.81609 [22] 20.13033 55.89481 158.66436 110.37836 96.26882 58.26059 126.98942 > arr.range [1] 113.9 66.4 27.8 336.7 202.6 191.7 116.0 241.8 209.5 112.8 53.9 113.3 [13] 222.5 177.7 236.5 138.3 301.4 302.3 300.9 355.6 192.1 38.9 118.5 341.0 [25] 252.8 210.3 139.1 267.9 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 29.471134 0.006916 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -3.4949 0.8685 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 74.07707 0.01474 > postscript(file="/var/www/rcomp/tmp/174js1274800247.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/rcomp/tmp/274js1274800247.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3tn0g1274800247.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/rcomp/tmp/4eny41274800247.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/rcomp/tmp/506fs1274800247.tab") > > try(system("convert tmp/174js1274800247.ps tmp/174js1274800247.png",intern=TRUE)) character(0) > try(system("convert tmp/274js1274800247.ps tmp/274js1274800247.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.65 0.52 1.02