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(1.579,2.146,2.462,3.695,4.831,5.134,6.250,5.760,6.249,2.917,1.741,2.359,1.511,2.059,2.635,2.867,4.403,5.720,4.502,5.749,5.627,2.846,1.762,2.429,1.169,2.154,2.249,2.687,4.359,5.382,4.459,6.398,4.596,3.024,1.887,2.070,1.351,2.218,2.461,3.028,4.784,4.975,4.607,6.249,4.809,3.157,1.910,2.228,1.594,2.467,2.222,3.607,4.685,4.962,5.770,5.480,5.000,3.228,1.993,2.288,1.580,2.111,2.192,3.601,4.665,4.876,5.813,5.589,5.331,3.075,2.002,2.306,1.507,1.992,2.487,3.490,4.647,5.594,5.611,5.788,6.204,3.013,1.931,2.549,1.504,2.090,2.702,2.939,4.500,6.208,6.415,5.657,5.964,3.163,1.997,2.422,1.376,2.202,2.683,3.303,5.202,5.231,4.880,7.998,4.977,3.531,2.025,2.205,1.442,2.238,2.179,3.218,5.139,4.990,4.914,6.084,5.672,3.548,1.793,2.086) > 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] [,10] [1,] 1.579 1.511 1.169 1.351 1.594 1.580 1.507 1.504 1.376 1.442 [2,] 2.146 2.059 2.154 2.218 2.467 2.111 1.992 2.090 2.202 2.238 [3,] 2.462 2.635 2.249 2.461 2.222 2.192 2.487 2.702 2.683 2.179 [4,] 3.695 2.867 2.687 3.028 3.607 3.601 3.490 2.939 3.303 3.218 [5,] 4.831 4.403 4.359 4.784 4.685 4.665 4.647 4.500 5.202 5.139 [6,] 5.134 5.720 5.382 4.975 4.962 4.876 5.594 6.208 5.231 4.990 [7,] 6.250 4.502 4.459 4.607 5.770 5.813 5.611 6.415 4.880 4.914 [8,] 5.760 5.749 6.398 6.249 5.480 5.589 5.788 5.657 7.998 6.084 [9,] 6.249 5.627 4.596 4.809 5.000 5.331 6.204 5.964 4.977 5.672 [10,] 2.917 2.846 3.024 3.157 3.228 3.075 3.013 3.163 3.531 3.548 [11,] 1.741 1.762 1.887 1.910 1.993 2.002 1.931 1.997 2.025 1.793 [12,] 2.359 2.429 2.070 2.228 2.288 2.306 2.549 2.422 2.205 2.086 > 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] 3.760250 3.509167 3.369500 3.481417 3.608000 3.595083 3.734417 3.796750 [9] 3.801083 3.608583 > arr.sd [1] 1.789635 1.598461 1.621986 1.541659 1.504044 1.578135 1.729940 1.832931 [9] 1.904048 1.671338 > arr.range [1] 4.671 4.238 5.229 4.898 4.176 4.233 4.697 4.911 6.622 4.642 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -0.9048 0.7120 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -1.393 1.481 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -0.5138 1.4740 > postscript(file="/var/www/html/rcomp/tmp/133361291981194.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/233361291981194.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/3o4jc1291981194.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/4smi01291981194.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/56egr1291981194.tab") > > try(system("convert tmp/133361291981194.ps tmp/133361291981194.png",intern=TRUE)) character(0) > try(system("convert tmp/233361291981194.ps tmp/233361291981194.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.513 0.296 3.334