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(518.1,523.3,536.1,538.2,561.2,562,577.6,606.9,607.3,617.2,625.2,637.3,652.9,653.9,670.4,677.2,710,729.9,742.6,748.2,808.4,844.3,854.2,1446,1527.6,1544.1,1596.1,1620.1,1625.4,1656.5,1667.6,1672.9,1685.1,1726.5,1755.9,1758.2,1795,1801.2,1819,1837.3,1851.8,1858.1,1881.2,1898.4,1936.5,1936.5,1954.9,1963.5,1964.1,1966.1,1981.8,1983.5,2004.7,2058.6,2083.1,2085.2,2086.9,2098.9,2100.2,2117.9,2130.6,2133.3,2144.6,2164.4,2230.2,2235,2236.6,2255.3,2288.6,2292.5,2337,2338.4,2365.4,2371.2,2385.4,2386,2390,2405,2407.2,2432.6,2432.6,2448.3,2471.9,2477.9,2490,2515.7,2535.8,2543.8,2560.8,2573.7,2584.3,2605.1,2607.3,2607.3,2668.6,2671.2,2685.9,2705.6,2724.5,2727.3,2735.6,2790.7,2798.7,2812.3,2812.3,2839.3,2862.5,2862.5,2862.9,2862.9,2866,2887.2,2934.9,3053.2) > par1 = '12' > #'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] 114 > (np <- floor(n / par1)) [1] 9 > 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,] 518.1 652.9 1527.6 1795.0 1964.1 2130.6 2365.4 2490.0 2685.9 [2,] 523.3 653.9 1544.1 1801.2 1966.1 2133.3 2371.2 2515.7 2705.6 [3,] 536.1 670.4 1596.1 1819.0 1981.8 2144.6 2385.4 2535.8 2724.5 [4,] 538.2 677.2 1620.1 1837.3 1983.5 2164.4 2386.0 2543.8 2727.3 [5,] 561.2 710.0 1625.4 1851.8 2004.7 2230.2 2390.0 2560.8 2735.6 [6,] 562.0 729.9 1656.5 1858.1 2058.6 2235.0 2405.0 2573.7 2790.7 [7,] 577.6 742.6 1667.6 1881.2 2083.1 2236.6 2407.2 2584.3 2798.7 [8,] 606.9 748.2 1672.9 1898.4 2085.2 2255.3 2432.6 2605.1 2812.3 [9,] 607.3 808.4 1685.1 1936.5 2086.9 2288.6 2432.6 2607.3 2812.3 [10,] 617.2 844.3 1726.5 1936.5 2098.9 2292.5 2448.3 2607.3 2839.3 [11,] 625.2 854.2 1755.9 1954.9 2100.2 2337.0 2471.9 2668.6 2862.5 [12,] 637.3 1446.0 1758.2 1963.5 2117.9 2338.4 2477.9 2671.2 2862.5 > 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] 575.8667 794.8333 1653.0000 1877.7833 2044.2500 2232.2083 2414.4583 [8] 2580.3000 2779.7667 > arr.sd [1] 41.97208 216.54686 74.69677 59.92524 59.11370 75.08644 37.90000 [8] 55.76925 61.71648 > arr.range [1] 119.2 793.1 230.6 168.5 153.8 207.8 112.5 181.2 176.6 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 139.74876 -0.03392 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 6.3792 -0.2947 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 493.3235 -0.1355 > postscript(file="/var/www/html/rcomp/tmp/1x99n1259187933.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/2z3m51259187933.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/3qll21259187933.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/4trhj1259187933.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/5oey21259187933.tab") > system("convert tmp/1x99n1259187933.ps tmp/1x99n1259187933.png") > system("convert tmp/2z3m51259187933.ps tmp/2z3m51259187933.png") > > > proc.time() user system elapsed 0.526 0.290 0.719