R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(175.348,154.439,136.186,113.662,106.157,100.546,98.314,118.179,112.295,126.938,130.92,181.279,180.389,146.917,150.597,124.222,101.554,102.138,110.315,111.015,105.017,119.888,127.623,149.415,159.755,139.737,136.283,101.952,104.044,96.712,100.665,103.699,103.765,122.732,127.297,160.278,191.784,155.375,142.616,115.331,102.136,95.205,101.566,105.273,117.394,121.148,116.666,154.841,177.74,154.427,133.159,118.102,101.361,101.345,102.233,108.522,101.939,118.405,125.06,178,167.714,143.582,139.259,104.674,103.722,106.153,106.21,113.986,96.906,107.512,112.616,148.507,130.48,137.436,128.21,97.552,91.55,83.104,84.68,85.98,84.891,89.896,94.835,115.348,131.284,134.701,127.193,87.077,72.744,77.542,78.005,85.329,86.041,96.384,116.678,160.672,152.364,144.936,122.974,94.456,82.491,84.89,85.277,81.206,71.012,87.302,97.427,133.242,137.064,119.042,116.47,96.028,79.281,73.872,80.964,86.739,89.997,96.292,101.355,136.543) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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,] 175.348 180.389 159.755 191.784 177.740 167.714 130.480 131.284 152.364 [2,] 154.439 146.917 139.737 155.375 154.427 143.582 137.436 134.701 144.936 [3,] 136.186 150.597 136.283 142.616 133.159 139.259 128.210 127.193 122.974 [4,] 113.662 124.222 101.952 115.331 118.102 104.674 97.552 87.077 94.456 [5,] 106.157 101.554 104.044 102.136 101.361 103.722 91.550 72.744 82.491 [6,] 100.546 102.138 96.712 95.205 101.345 106.153 83.104 77.542 84.890 [7,] 98.314 110.315 100.665 101.566 102.233 106.210 84.680 78.005 85.277 [8,] 118.179 111.015 103.699 105.273 108.522 113.986 85.980 85.329 81.206 [9,] 112.295 105.017 103.765 117.394 101.939 96.906 84.891 86.041 71.012 [10,] 126.938 119.888 122.732 121.148 118.405 107.512 89.896 96.384 87.302 [11,] 130.920 127.623 127.297 116.666 125.060 112.616 94.835 116.678 97.427 [12,] 181.279 149.415 160.278 154.841 178.000 148.507 115.348 160.672 133.242 [,10] [1,] 137.064 [2,] 119.042 [3,] 116.470 [4,] 96.028 [5,] 79.281 [6,] 73.872 [7,] 80.964 [8,] 86.739 [9,] 89.997 [10,] 96.292 [11,] 101.355 [12,] 136.543 > 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] 129.5219 127.4242 121.4099 126.6112 126.6911 120.9034 101.9968 104.4708 [9] 103.1314 101.1372 > arr.sd [1] 27.78023 24.57943 23.19897 28.82052 28.63536 22.70010 20.14760 28.54486 [9] 27.66711 21.55134 > arr.range [1] 82.965 78.835 63.566 96.579 76.655 70.808 54.332 87.928 81.352 63.192 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 13.4454 0.1024 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 0.8805 0.4935 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 26.8962 0.4189 > postscript(file="/var/www/rcomp/tmp/1i4to1292944371.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/rcomp/tmp/2i4to1292944371.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/3l5rc1292944371.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/rcomp/tmp/47nqi1292944371.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/rcomp/tmp/5s6o61292944371.tab") > > try(system("convert tmp/1i4to1292944371.ps tmp/1i4to1292944371.png",intern=TRUE)) character(0) > try(system("convert tmp/2i4to1292944371.ps tmp/2i4to1292944371.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.610 0.170 0.762