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. Natural language support but running in an English locale 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(27.951,29.781,32.914,33.488,35.652,36.488,35.387,35.676,34.844,32.447,31.068,29.010,29.812,30.951,32.974,32.936,34.012,32.946,31.948,30.599,27.691,25.073,23.406,22.248,22.896,25.317,26.558,26.471,27.543,26.198,24.725,25.005,23.462,20.780,19.815,19.761,21.454,23.899,24.939,23.580,24.562,24.696,23.785,23.812,21.917,19.713,19.282,18.788,21.453,24.482,27.474,27.264,27.349,30.632,29.429,30.084,26.290,24.379,23.335,21.346,21.106,24.514,28.353,30.805,31.348,34.556,33.855,34.787,32.529,29.998,29.257,28.155,30.466,35.704,39.327,39.351,42.234,43.630,43.722,43.121,37.985,37.135,34.646,33.026,35.087,38.846,42.013,43.908,42.868,44.423,44.167,43.636,44.382,42.142,43.452,36.912,42.413,45.344,44.873,47.510,49.554,47.369,45.998,48.140,48.441,44.928,40.454,38.661,37.246,36.843,36.424,37.594,38.144,38.737,34.560,36.080,33.508,35.462,33.374,32.110,35.533,35.532,37.903,36.763,40.399,44.164,44.496,43.110,43.880,43.930,44.327) > 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] 131 > (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] [,10] [1,] 27.951 29.812 22.896 21.454 21.453 21.106 30.466 35.087 42.413 37.246 [2,] 29.781 30.951 25.317 23.899 24.482 24.514 35.704 38.846 45.344 36.843 [3,] 32.914 32.974 26.558 24.939 27.474 28.353 39.327 42.013 44.873 36.424 [4,] 33.488 32.936 26.471 23.580 27.264 30.805 39.351 43.908 47.510 37.594 [5,] 35.652 34.012 27.543 24.562 27.349 31.348 42.234 42.868 49.554 38.144 [6,] 36.488 32.946 26.198 24.696 30.632 34.556 43.630 44.423 47.369 38.737 [7,] 35.387 31.948 24.725 23.785 29.429 33.855 43.722 44.167 45.998 34.560 [8,] 35.676 30.599 25.005 23.812 30.084 34.787 43.121 43.636 48.140 36.080 [9,] 34.844 27.691 23.462 21.917 26.290 32.529 37.985 44.382 48.441 33.508 [10,] 32.447 25.073 20.780 19.713 24.379 29.998 37.135 42.142 44.928 35.462 [11,] 31.068 23.406 19.815 19.282 23.335 29.257 34.646 43.452 40.454 33.374 [12,] 29.010 22.248 19.761 18.788 21.346 28.155 33.026 36.912 38.661 32.110 > 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] 32.89217 29.54967 24.04425 22.53558 26.12642 29.93858 38.36225 41.81967 [9] 45.30708 35.84017 > arr.sd [1] 2.882190 4.023574 2.707564 2.232809 3.158598 4.081191 4.362779 3.143168 [9] 3.328894 2.075235 > arr.range [1] 8.537 11.764 7.782 6.151 9.286 13.681 13.256 9.336 10.893 6.627 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 2.36114 0.02569 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 0.0596 0.3109 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 5.9929 0.1145 > postscript(file="/var/www/html/freestat/rcomp/tmp/17dqb1292519321.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/freestat/rcomp/tmp/27dqb1292519321.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/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/3bv6h1292519321.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/4wenn1292519321.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/5a52v1292519321.tab") > > try(system("convert tmp/17dqb1292519321.ps tmp/17dqb1292519321.png",intern=TRUE)) character(0) > try(system("convert tmp/27dqb1292519321.ps tmp/27dqb1292519321.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.822 0.408 0.950