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(49.32,58.53,49.09,24.68,16.71,19.86,38.23,36.11,19.59,14.91,15.74,15.40,13.06,19.07,15.28,15.82,12.77,12.05,11.69,13.85,13.85,10.07,9.17,10.79,13.44,21.17,18.64,13.21,15.54,21.94,23.11,18.64,14.94,16.90,15.46,11.15,13.13,12.48,12.95,12.59,10.58,10.58,12.39,15.53,13.06,10.22,16.33,19.72,21.31,18.84,24.84,15.67,15.57,12.73,13.56,15.54,17.22,12.14,11.07,12.02,11.55,6.92,10.33,8.38,12.11,11.46,12.75,13.32,13.00,11.90,11.79,12.55,11.84,11.25,11.15,10.99,11.70,14.01,17.51,17.27,16.90,15.79,15.45,16.24,16.71,16.77,16.64,17.80,16.87,16.13,15.76,15.66,15.54,15.30,15.05,14.69,14.39,14.18,13.70,13.66,13.27,13.56,13.14,14.19,22.57,23.09,23.31,22.91,22.36,43.06,64.67,64.68,56.90,48.79,45.21,41.40,22.17,25.52,20.28,22.87,27.63,22.95,21.35,18.38,17.15,18.27,19.40,20.52) > 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] 128 > (np <- floor(n / par1)) [1] 32 > 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,] 49.32 16.71 19.59 13.06 12.77 13.85 13.44 15.54 14.94 13.13 10.58 13.06 [2,] 58.53 19.86 14.91 19.07 12.05 10.07 21.17 21.94 16.90 12.48 10.58 10.22 [3,] 49.09 38.23 15.74 15.28 11.69 9.17 18.64 23.11 15.46 12.95 12.39 16.33 [4,] 24.68 36.11 15.40 15.82 13.85 10.79 13.21 18.64 11.15 12.59 15.53 19.72 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 21.31 15.57 17.22 11.55 12.11 13.00 11.84 11.70 16.90 16.71 16.87 15.54 [2,] 18.84 12.73 12.14 6.92 11.46 11.90 11.25 14.01 15.79 16.77 16.13 15.30 [3,] 24.84 13.56 11.07 10.33 12.75 11.79 11.15 17.51 15.45 16.64 15.76 15.05 [4,] 15.67 15.54 12.02 8.38 13.32 12.55 10.99 17.27 16.24 17.80 15.66 14.69 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [1,] 14.39 13.27 22.57 22.36 56.90 22.17 27.63 17.15 [2,] 14.18 13.56 23.09 43.06 48.79 25.52 22.95 18.27 [3,] 13.70 13.14 23.31 64.67 45.21 20.28 21.35 19.40 [4,] 13.66 14.19 22.91 64.68 41.40 22.87 18.38 20.52 > 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] 45.4050 27.7275 16.4100 15.8075 12.5900 10.9700 16.6150 19.8075 14.6125 [10] 12.7875 12.2700 14.8325 20.1650 14.3500 13.1125 9.2950 12.4100 12.3100 [19] 11.3075 15.1225 16.0950 16.9800 16.1050 15.1450 13.9825 13.5400 22.9700 [28] 48.6925 48.0750 22.7100 22.5775 18.8350 > arr.sd [1] 14.4993988 11.0128966 2.1471997 2.4813353 0.9524705 2.0311573 [7] 3.9379902 3.4170492 2.4526907 0.3040148 2.3348233 4.1047564 [13] 3.8784576 1.4321313 2.7798486 2.0521615 0.8033679 0.5692685 [19] 0.3707987 2.7846649 0.6266578 0.5492419 0.5486043 0.3633639 [25] 0.3600347 0.4675468 0.3128365 20.2978347 6.6120017 2.1693471 [31] 3.8640339 1.4510801 > arr.range [1] 33.85 21.52 4.68 6.01 2.16 4.68 7.96 7.57 5.75 0.65 4.95 9.50 [13] 9.17 2.84 6.15 4.63 1.86 1.21 0.85 5.81 1.45 1.16 1.21 0.85 [25] 0.73 1.05 0.74 42.32 15.50 5.24 9.25 3.37 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -3.6076 0.3602 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -4.508 1.768 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -7.8560 0.7887 > postscript(file="/var/www/html/rcomp/tmp/12h8u1244446551.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/28yxe1244446551.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/38yxs1244446551.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/46mze1244446551.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/5luo01244446551.tab") > > system("convert tmp/12h8u1244446551.ps tmp/12h8u1244446551.png") > system("convert tmp/28yxe1244446551.ps tmp/28yxe1244446551.png") > > > proc.time() user system elapsed 0.523 0.284 1.238