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(25.22,27.63,27.47,22.54,27.4,29.68,28.51,29.89,32.62,30.93,32.52,25.28,25.64,27.41,24.4,25.55,28.45,27.72,24.54,25.67,25.54,20.48,18.94,18.6,19.49,20.29,23.69,25.65,25.43,24.13,25.77,26.63,28.34,27.55,24.5,28.52,31.29,32.65,30.34,25.02,25.81,27.55,28.4,29.83,27.1,29.59,28.77,29.88,31.18,30.87,33.8,33.36,37.92,35.19,38.37,43.03,43.38,49.77,43.05,39.65,44.28,45.56,53.08,51.86,48.67,54.31,57.58,64.09,62.98,58.52,55.54,56.75,63.57,59.92,62.25,70.44,70.19,68.86,73.9,73.61,62.77,58.38,58.48,62.31,54.3,57.76,62.14,67.4,67.48,71.32,77.2,70.8,77.13,83.04,92.53,91.45,91.92,94.82,103.28,110.44,123.94,133.05,133.9,113.85,99.06,72.84,53.24,41.58,44.86,43.24,46.84,50.85,57.94,68.59,64.92,72.5,67.69,73.19,77.04,74.67) > 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,] 25.22 25.64 19.49 31.29 31.18 44.28 63.57 54.30 91.92 44.86 [2,] 27.63 27.41 20.29 32.65 30.87 45.56 59.92 57.76 94.82 43.24 [3,] 27.47 24.40 23.69 30.34 33.80 53.08 62.25 62.14 103.28 46.84 [4,] 22.54 25.55 25.65 25.02 33.36 51.86 70.44 67.40 110.44 50.85 [5,] 27.40 28.45 25.43 25.81 37.92 48.67 70.19 67.48 123.94 57.94 [6,] 29.68 27.72 24.13 27.55 35.19 54.31 68.86 71.32 133.05 68.59 [7,] 28.51 24.54 25.77 28.40 38.37 57.58 73.90 77.20 133.90 64.92 [8,] 29.89 25.67 26.63 29.83 43.03 64.09 73.61 70.80 113.85 72.50 [9,] 32.62 25.54 28.34 27.10 43.38 62.98 62.77 77.13 99.06 67.69 [10,] 30.93 20.48 27.55 29.59 49.77 58.52 58.38 83.04 72.84 73.19 [11,] 32.52 18.94 24.50 28.77 43.05 55.54 58.48 92.53 53.24 77.04 [12,] 25.28 18.60 28.52 29.88 39.65 56.75 62.31 91.45 41.58 74.67 > 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] 28.30750 24.41167 24.99917 28.85250 38.29750 54.43500 65.39000 72.71250 [9] 97.66000 61.86083 > arr.sd [1] 3.039076 3.317907 2.847214 2.216763 5.756415 6.201185 5.696121 [8] 12.156966 29.373094 12.514151 > arr.range [1] 10.08 9.85 9.03 7.63 18.90 19.81 15.52 38.23 92.32 33.80 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -6.3572 0.2952 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -3.834 1.482 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -19.4675 0.9053 > postscript(file="/var/www/rcomp/tmp/14vcp1293300733.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/24vcp1293300733.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/3qdav1293300733.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/4bwrj1293300733.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/5ee771293300733.tab") > > try(system("convert tmp/14vcp1293300733.ps tmp/14vcp1293300733.png",intern=TRUE)) character(0) > try(system("convert tmp/24vcp1293300733.ps tmp/24vcp1293300733.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.550 0.260 0.793