R version 2.6.2 (2008-02-08) Copyright (C) 2008 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(11835.70,11542.20,13093.70,11180.20,12035.70,12112.00,10875.20,9897.30,11672.10,12385.70,11405.60,9830.90,11025.10,10853.80,12252.60,11839.40,11669.10,11601.40,11178.40,9516.40,12102.80,12989.00,11610.20,10205.50,11356.20,11307.10,12648.60,11947.20,11714.10,12192.50,11268.80,9097.40,12639.80,13040.10,11687.30,11191.70,11391.90,11793.10,13933.20,12778.10,11810.30,13698.40,11956.60,10723.80,13938.90,13979.80,13807.40,12973.90,12509.80,12934.10,14908.30,13772.10,13012.60,14049.90,11816.50,11593.20,14466.20,13615.90,14733.90,13880.70,13527.50,13584.00,16170.20,13260.60,14741.90,15486.50,13154.50,12621.20,15031.60,15452.40,15428.00,13105.90,14716.80,14180.00,16202.20,14392.40,15140.60,15960.10,14729.90,13705.20,15728.50,17315.60,16152.80) > 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] 83 > (np <- floor(n / par1)) [1] 20 > 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,] 11835.7 12035.7 11672.1 11025.1 11669.1 12102.8 11356.2 11714.1 12639.8 [2,] 11542.2 12112.0 12385.7 10853.8 11601.4 12989.0 11307.1 12192.5 13040.1 [3,] 13093.7 10875.2 11405.6 12252.6 11178.4 11610.2 12648.6 11268.8 11687.3 [4,] 11180.2 9897.3 9830.9 11839.4 9516.4 10205.5 11947.2 9097.4 11191.7 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 11391.9 11810.3 13938.9 12509.8 13012.6 14466.2 13527.5 14741.9 15031.6 [2,] 11793.1 13698.4 13979.8 12934.1 14049.9 13615.9 13584.0 15486.5 15452.4 [3,] 13933.2 11956.6 13807.4 14908.3 11816.5 14733.9 16170.2 13154.5 15428.0 [4,] 12778.1 10723.8 12973.9 13772.1 11593.2 13880.7 13260.6 12621.2 13105.9 [,19] [,20] [1,] 14716.8 15140.6 [2,] 14180.0 15960.1 [3,] 16202.2 14729.9 [4,] 14392.4 13705.2 > 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] 11912.95 11230.05 11323.58 11492.73 10991.33 11726.88 11814.78 11068.20 [9] 12139.73 12474.08 12047.27 13675.00 13531.08 12618.05 14174.17 14135.58 [17] 14001.02 14754.48 14872.85 14883.95 > arr.sd [1] 831.5680 1053.4149 1077.7115 664.4526 1006.9709 1163.6830 627.3822 [8] 1366.9346 849.3507 1133.7705 1230.4713 473.1516 1057.3904 1139.9801 [15] 515.2246 1363.7290 1338.6627 1115.8454 913.3083 937.5768 > arr.range [1] 1913.5 2214.7 2554.8 1398.8 2152.7 2783.5 1341.5 3095.1 1848.4 2541.3 [11] 2974.6 1005.9 2398.5 2456.7 1118.0 2909.6 2865.3 2346.5 2022.2 2254.9 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 1170.48888 -0.01393 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 9.704 -0.301 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 2782.86255 -0.04497 > postscript(file="/var/www/html/freestat/rcomp/tmp/1k21b1210622004.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/freestat/rcomp/tmp/2ot3u1210622004.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/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/3kodx1210622004.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/44znq1210622004.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/5ef621210622004.tab") > > system("convert tmp/1k21b1210622004.ps tmp/1k21b1210622004.png") > system("convert tmp/2ot3u1210622004.ps tmp/2ot3u1210622004.png") > > > proc.time() user system elapsed 1.015 0.394 1.159