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(104.28,104.33,104.46,104.46,104.5,104.61,104.66,104.66,105.03,105.32,105.52,105.67,105.71,105.81,106,106.02,106.19,106.22,106.34,106.42,106.84,107.23,107.42,107.63,107.69,107.81,107.92,108.06,108.21,108.44,108.55,108.66,109.23,109.7,109.94,110.13,110.39,110.46,110.67,110.89,110.98,111.12,111.33,111.43,111.87,112.22,112.47,112.64,112.84,113.03,113.09,113.27,113.44,113.51,113.66,113.62,114.01,114.55,114.77,114.87,115.11,115.09,115.24,115.27,115.41,115.59,115.6,115.68,116.2,116.55,116.73,117.04,117.12,117.28,117.48,117.66,117.92,118.12,118.17,118.39) > 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] 80 > (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] [,10] [1,] 104.28 104.50 105.03 105.71 106.19 106.84 107.69 108.21 109.23 110.39 [2,] 104.33 104.61 105.32 105.81 106.22 107.23 107.81 108.44 109.70 110.46 [3,] 104.46 104.66 105.52 106.00 106.34 107.42 107.92 108.55 109.94 110.67 [4,] 104.46 104.66 105.67 106.02 106.42 107.63 108.06 108.66 110.13 110.89 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 110.98 111.87 112.84 113.44 114.01 115.11 115.41 116.20 117.12 117.92 [2,] 111.12 112.22 113.03 113.51 114.55 115.09 115.59 116.55 117.28 118.12 [3,] 111.33 112.47 113.09 113.66 114.77 115.24 115.60 116.73 117.48 118.17 [4,] 111.43 112.64 113.27 113.62 114.87 115.27 115.68 117.04 117.66 118.39 > 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] 104.3825 104.6075 105.3850 105.8850 106.2925 107.2800 107.8700 108.4650 [9] 109.7500 110.6025 111.2150 112.3000 113.0575 113.5575 114.5500 115.1775 [17] 115.5700 116.6300 117.3850 118.1500 > arr.sd [1] 0.09178780 0.07544314 0.27670682 0.15022206 0.10688779 0.33575785 [7] 0.15769168 0.19226718 0.38875871 0.22559181 0.20305993 0.33456439 [13] 0.17727098 0.10078856 0.38401389 0.09069179 0.11401754 0.35090360 [19] 0.23515952 0.19304576 > arr.range [1] 0.18 0.16 0.64 0.31 0.23 0.79 0.37 0.45 0.90 0.50 0.45 0.77 0.43 0.22 0.86 [16] 0.18 0.27 0.84 0.54 0.47 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -0.339580 0.004948 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -16.877 3.226 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -0.96538 0.01301 > postscript(file="/var/www/html/rcomp/tmp/12ygr1262799484.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/2n9h81262799484.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/34i2u1262799484.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/4njr21262799484.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/56ynd1262799484.tab") > > try(system("convert tmp/12ygr1262799484.ps tmp/12ygr1262799484.png",intern=TRUE)) character(0) > try(system("convert tmp/2n9h81262799484.ps tmp/2n9h81262799484.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.530 0.306 0.674