R version 2.8.0 (2008-10-20) 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(18288.3,16049,16764.5,17880.2,16555.9,16087.1,16373.5,17842.2,22321.5,22786.7,18274.1,22392.9,23899.3,21343.5,22952.3,21374.4,21164.1,20906.5,17877.4,20664.3,22160,19813.6,17735.4,19640.2,20844.4,19823.1,18594.6,21350.6,18574.1,18924.2,17343.4,19961.2,19932.1,19464.6,16165.4,17574.9,19795.4,19439.5,17170,21072.4,17751.8,17515.5,18040.3,19090.1,17746.5,19202.1,15141.6,16258.1,18586.5,17209.4,17838.7,19123.5,16583.6,15991.2,16704.5,17422,17872,17823.2,13866.5,15912.8,17870.5,15420.3,16379.4,17903.9,15305.8,14583.3,14861,14968.9,16726.5,16283.6,11703.7,15101.8,15469.7,14956.9,15370.6,15998.1,14725.1,14768.9,13659.6,15070.3,16942.6,15761.3,12083,15023.6,15106.5) > 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] 85 > (np <- floor(n / par1)) [1] 21 > 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,] 18288.3 16555.9 22321.5 23899.3 21164.1 22160.0 20844.4 18574.1 19932.1 [2,] 16049.0 16087.1 22786.7 21343.5 20906.5 19813.6 19823.1 18924.2 19464.6 [3,] 16764.5 16373.5 18274.1 22952.3 17877.4 17735.4 18594.6 17343.4 16165.4 [4,] 17880.2 17842.2 22392.9 21374.4 20664.3 19640.2 21350.6 19961.2 17574.9 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 19795.4 17751.8 17746.5 18586.5 16583.6 17872.0 17870.5 15305.8 16726.5 [2,] 19439.5 17515.5 19202.1 17209.4 15991.2 17823.2 15420.3 14583.3 16283.6 [3,] 17170.0 18040.3 15141.6 17838.7 16704.5 13866.5 16379.4 14861.0 11703.7 [4,] 21072.4 19090.1 16258.1 19123.5 17422.0 15912.8 17903.9 14968.9 15101.8 [,19] [,20] [,21] [1,] 15469.7 14725.1 16942.6 [2,] 14956.9 14768.9 15761.3 [3,] 15370.6 13659.6 12083.0 [4,] 15998.1 15070.3 15023.6 > 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] 17245.50 16714.67 21443.80 22392.38 20153.08 19837.30 20153.17 18700.72 [9] 18284.25 19369.33 18099.42 17087.08 18189.53 16675.33 16368.62 16893.53 [17] 14929.75 14953.90 15448.83 14555.98 14952.62 > arr.sd [1] 1025.2234 776.0526 2123.0110 1254.4256 1530.7807 1812.2113 1217.8840 [8] 1079.6764 1741.7748 1625.2138 694.4408 1768.2614 839.3691 587.3146 [15] 1901.2567 1212.4430 298.7198 2272.7287 428.2710 616.9707 2069.9228 > arr.range [1] 2239.3 1755.1 4512.6 2555.8 3286.7 4424.6 2756.0 2617.8 3766.7 3902.4 [11] 1574.6 4060.5 1914.1 1430.8 4005.5 2483.6 722.5 5022.8 1041.2 1410.7 [21] 4859.6 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 53.40587 0.06915 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -9.726 1.713 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 395.7906 0.1397 > postscript(file="/var/www/html/freestat/rcomp/tmp/1q1ju1274033288.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/2q1ju1274033288.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/3u2zi1274033288.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/4flyo1274033288.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/5ilec1274033288.tab") > > try(system("convert tmp/1q1ju1274033288.ps tmp/1q1ju1274033288.png",intern=TRUE)) character(0) > try(system("convert tmp/2q1ju1274033288.ps tmp/2q1ju1274033288.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.762 0.421 0.833