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(3722.7,3707.1,3697.4,3691.4,3679.4,3660.6,3647.5,3639,3623.5,3612.2,3604.2,3596.9,3603.9,3606.9,3607.7,3611.4,3611.9,3618.4,3629.5,3640.6,3646.8,3647.3,3649.5,3649.7,3652.5,3665.8,3674.3,3705.8,3735.8,3735.4,3747.7,3765.5,3779.7,3795.5,3813.1,3826.9,3833.3,3844.8,3851.3,3851.8,3854.1,3858.4,3861.6,3856.3,3855.8,3860.4,3855.1,3839.5,3833,3833.6,3826.8,3818.2,3811.4,3806.8,3810.3,3818.2,3858.7,3868.7,3872.6,3872.4,3876.4,3883.2,3883.4,3881.8,3887.1,3893.3,3902.8,3914.7,3929.8,3947.3,3971.8,3991.3,3993,3997.2,4016.2,4041.7,4060.5,4076.7,4102.7,4125.8,4140.1,4146.7,4157.9,4154.7,4145.3,4149,4142.4,4141,4146.1,4147.6,4142.7,4148.1,4159,4167,4178.5,4192.5,4209.2,4223.7,4231.6,4236.9,4253,4270.5,4285.7,4302.8,4321.5,4340.3,4356.5) > 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] 107 > (np <- floor(n / par1)) [1] 8 > 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] [1,] 3722.7 3603.9 3652.5 3833.3 3833.0 3876.4 3993.0 4145.3 [2,] 3707.1 3606.9 3665.8 3844.8 3833.6 3883.2 3997.2 4149.0 [3,] 3697.4 3607.7 3674.3 3851.3 3826.8 3883.4 4016.2 4142.4 [4,] 3691.4 3611.4 3705.8 3851.8 3818.2 3881.8 4041.7 4141.0 [5,] 3679.4 3611.9 3735.8 3854.1 3811.4 3887.1 4060.5 4146.1 [6,] 3660.6 3618.4 3735.4 3858.4 3806.8 3893.3 4076.7 4147.6 [7,] 3647.5 3629.5 3747.7 3861.6 3810.3 3902.8 4102.7 4142.7 [8,] 3639.0 3640.6 3765.5 3856.3 3818.2 3914.7 4125.8 4148.1 [9,] 3623.5 3646.8 3779.7 3855.8 3858.7 3929.8 4140.1 4159.0 [10,] 3612.2 3647.3 3795.5 3860.4 3868.7 3947.3 4146.7 4167.0 [11,] 3604.2 3649.5 3813.1 3855.1 3872.6 3971.8 4157.9 4178.5 [12,] 3596.9 3649.7 3826.9 3839.5 3872.4 3991.3 4154.7 4192.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] 3656.825 3626.967 3741.500 3851.867 3835.892 3913.575 4084.433 4154.933 > arr.sd [1] 42.746358 18.762406 57.934854 8.574416 25.406386 38.478001 62.114108 [8] 16.337816 > arr.range [1] 125.8 45.8 174.4 28.3 65.8 114.9 164.9 51.5 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 23.179288 0.002751 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 7.1667 -0.4637 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 81.18459 0.00395 > postscript(file="/var/www/html/rcomp/tmp/131of1210335559.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/220ll1210335559.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/38n2g1210335559.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/48w341210335560.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/52e2t1210335560.tab") > > system("convert tmp/131of1210335559.ps tmp/131of1210335559.png") > system("convert tmp/220ll1210335559.ps tmp/220ll1210335559.png") > > > proc.time() user system elapsed 0.740 0.285 0.881