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(98.6,98.8,99.9,100.3,100.2,100.2,100.6,100.4,100.7,100.9,99.7,99.7,96.8,99.2,99.9,99.3,98.9,98.9,98.7,98.4,98.6,98.5,98.1,98.3,98.1,97.9,99.1,98.5,98.2,97.8,98,98,97.6,97.6,97.6,97.5,96.1,96.1,96.3,96.3,96.3,96,96,95.2,96,96.1,95.3,95.1,94.8,94.5,94.7,94.8,94.5,94.5,92.8,92.8,94.5,94.4,94.2,94.1,92.9,93.3,93.6,93.6,94,94,94.2,93.3,93,93,94.7,95.6,95.8,96,95.4,95.3,94.4,94.4,94.3,93.9,94.5,93.6,93.9,93.9,93.7,94.6,94.4,94,91.1,91.1,90.7,90.8,89.8,90.7,90.3,89.7,89,88.4,89.3,89.3,89.3,89.3,88.4,89.4,91.3,90.9,91,89.3,88.1,89,90.1,90.6,90.6,90.2,89.5,90.5,90.4,89.7,90,90.2,89.3,89.6,89.8,89.4,89.3,89.4,89.5,89.2,90,88,88.3,89.1) > 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] 132 > (np <- floor(n / par1)) [1] 11 > 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] [1,] 98.6 96.8 98.1 96.1 94.8 92.9 95.8 93.7 89.0 88.1 89.3 [2,] 98.8 99.2 97.9 96.1 94.5 93.3 96.0 94.6 88.4 89.0 89.6 [3,] 99.9 99.9 99.1 96.3 94.7 93.6 95.4 94.4 89.3 90.1 89.8 [4,] 100.3 99.3 98.5 96.3 94.8 93.6 95.3 94.0 89.3 90.6 89.4 [5,] 100.2 98.9 98.2 96.3 94.5 94.0 94.4 91.1 89.3 90.6 89.3 [6,] 100.2 98.9 97.8 96.0 94.5 94.0 94.4 91.1 89.3 90.2 89.4 [7,] 100.6 98.7 98.0 96.0 92.8 94.2 94.3 90.7 88.4 89.5 89.5 [8,] 100.4 98.4 98.0 95.2 92.8 93.3 93.9 90.8 89.4 90.5 89.2 [9,] 100.7 98.6 97.6 96.0 94.5 93.0 94.5 89.8 91.3 90.4 90.0 [10,] 100.9 98.5 97.6 96.1 94.4 93.0 93.6 90.7 90.9 89.7 88.0 [11,] 99.7 98.1 97.6 95.3 94.2 94.7 93.9 90.3 91.0 90.0 88.3 [12,] 99.7 98.3 97.5 95.1 94.1 95.6 93.9 89.7 89.3 90.2 89.1 > 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] 100.00000 98.63333 97.99167 95.90000 94.21667 93.76667 94.61667 [8] 91.74167 89.57500 89.90833 89.24167 > arr.sd [1] 0.7122308 0.7595852 0.4561864 0.4390071 0.6939129 0.7946793 0.8077278 [8] 1.8603315 0.9658957 0.7427937 0.5712161 > arr.range [1] 2.3 3.1 1.6 1.2 2.0 2.7 2.4 4.9 2.9 2.5 2.0 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 3.86169 -0.03252 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 14.952 -3.356 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 8.8538 -0.0674 > postscript(file="/var/www/rcomp/tmp/167fb1323294208.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/2lo0q1323294208.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/3mvu81323294208.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/4cv0l1323294208.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/5296y1323294208.tab") > > try(system("convert tmp/167fb1323294208.ps tmp/167fb1323294208.png",intern=TRUE)) character(0) > try(system("convert tmp/2lo0q1323294208.ps tmp/2lo0q1323294208.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.510 0.070 0.573