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(98.6,100.1,98.8,98.3,102.8,103.6,105.2,100.1,98.2,98.4,97.4,98.4,100.3,101.1,104.1,107.3,110.1,112.6,114.3,115.3,109.9,108.2,103.2,101.8,105.6,108.2,109.8,114.6,117.2,116.5,116.1,112.1,106.8,106.9,104.5,103,105.9,107.7,107.1,112.5,114.5,114.6,113.1,112.8,111.9,112,112.4,110,112.3,109.6,111.9,110.8,110.4,110.8,114,108.4,110.5,105.1,102.3,104.3,103.4,102.4,104.5,107.3,110.1,111.8,111.8,105.7,106,106.4,107.1,111.5,109.6,109.9,109.3,111.4,112.9,115.5,118.4,116.2,113.3,113.8,114.1,117.1,115.5,115.2,114.2,115.3,118.8,118,118.1,111.8,112,114.3,115,118.5,117.6,119.1,120.6,123.6,122.7,123.8,123.1,124.5,120.7,118.7,119,122.3,118.6,118.1,118.2,120.8,119.7,119.7,117.1,114.5,116.5,116.4,114.9,115.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] 120 > (np <- floor(n / par1)) [1] 30 > 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] [,11] [,12] [1,] 98.6 102.8 98.2 100.3 110.1 109.9 105.6 117.2 106.8 105.9 114.5 111.9 [2,] 100.1 103.6 98.4 101.1 112.6 108.2 108.2 116.5 106.9 107.7 114.6 112.0 [3,] 98.8 105.2 97.4 104.1 114.3 103.2 109.8 116.1 104.5 107.1 113.1 112.4 [4,] 98.3 100.1 98.4 107.3 115.3 101.8 114.6 112.1 103.0 112.5 112.8 110.0 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 112.3 110.4 110.5 103.4 110.1 106.0 109.6 112.9 113.3 115.5 118.8 112.0 [2,] 109.6 110.8 105.1 102.4 111.8 106.4 109.9 115.5 113.8 115.2 118.0 114.3 [3,] 111.9 114.0 102.3 104.5 111.8 107.1 109.3 118.4 114.1 114.2 118.1 115.0 [4,] 110.8 108.4 104.3 107.3 105.7 111.5 111.4 116.2 117.1 115.3 111.8 118.5 [,25] [,26] [,27] [,28] [,29] [,30] [1,] 117.6 122.7 120.7 118.6 119.7 116.5 [2,] 119.1 123.8 118.7 118.1 119.7 116.4 [3,] 120.6 123.1 119.0 118.2 117.1 114.9 [4,] 123.6 124.5 122.3 120.8 114.5 115.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] 98.950 102.925 98.100 103.200 113.075 105.775 109.550 115.475 105.300 [10] 108.300 113.750 111.575 111.150 110.900 105.550 104.400 109.850 107.750 [19] 110.050 115.750 114.575 115.050 116.675 114.950 120.225 123.525 120.175 [28] 118.925 117.750 115.825 > arr.sd [1] 0.7937254 2.1313141 0.4760952 3.1853833 2.2750458 3.8870512 3.7854986 [8] 2.2954665 1.8920888 2.8982753 0.9327379 1.0719919 1.2124356 2.3180452 [15] 3.5038075 2.1150256 2.8803935 2.5409972 0.9327379 2.2664216 1.7153717 [22] 0.5802298 3.2694291 2.6913441 2.5617377 0.7932003 1.6680827 1.2685293 [29] 2.4893105 0.7632169 > arr.range [1] 1.8 5.1 1.0 7.0 5.2 8.1 9.0 5.1 3.9 6.6 1.8 2.4 2.7 5.6 8.2 4.9 6.1 5.5 2.1 [20] 5.5 3.8 1.3 7.0 6.5 6.0 1.8 3.6 2.7 5.2 1.6 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 3.94331 -0.01710 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 1.0834 -0.1095 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 8.88739 -0.03879 > postscript(file="/var/www/html/rcomp/tmp/17n7h1291724825.ps",horizontal=F,onefile=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/27n7h1291724825.ps",horizontal=F,onefile=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/3a6651291724825.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/4w64t1291724825.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/5hplz1291724825.tab") > > try(system("convert tmp/17n7h1291724825.ps tmp/17n7h1291724825.png",intern=TRUE)) character(0) > try(system("convert tmp/27n7h1291724825.ps tmp/27n7h1291724825.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.536 0.307 1.343