R version 2.10.1 (2009-12-14) 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(17.1,13.4,15.3,14,9.7,13.7,13.7,12.5,9.8,7,-1.9,-2.9,-6.8,-10.4,-17.2,-19.8,-16.8,-23.2,-21.7,-17.6,-13,-12.6,-4,-0.2,3.1,6.5,19.2,26.6,26.6,31.4,31.2,26.4,20.7,20.7,15,13.3,8.7,10.2,4.3,-0.1,-4.6,-3.9,-3.5,-3.4,-2.5,-1.1,0.3,-0.9,3.6,2.7,-0.2,-1,5.8,6.4,9.6,13.2,10.6,10.9,12.9,15.9,12.2,9.1,9,17.4,14.7,17,13.7,9.5,14.8,13.6,12.6,8.9,10.2,12.7,16,10.4,9.9,9.5,8.6,10,3.5,-4.2,-4.4,-1.5,-0.1,0.8,-2.4,-1.2,0.2,-1.9,-1.6,-4.2,-2.2,6.2,5.7,3.1,1.1,-0.9,0.1,-4,-4,-5.3,-8,-6.3,-3.6,-3.5,-5.1,-3.3) > 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] 108 > (np <- floor(n / par1)) [1] 27 > 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] [,13] [1,] 17.1 9.7 9.8 -6.8 -16.8 -13.0 3.1 26.6 20.7 8.7 -4.6 -2.5 3.6 [2,] 13.4 13.7 7.0 -10.4 -23.2 -12.6 6.5 31.4 20.7 10.2 -3.9 -1.1 2.7 [3,] 15.3 13.7 -1.9 -17.2 -21.7 -4.0 19.2 31.2 15.0 4.3 -3.5 0.3 -0.2 [4,] 14.0 12.5 -2.9 -19.8 -17.6 -0.2 26.6 26.4 13.3 -0.1 -3.4 -0.9 -1.0 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 5.8 10.6 12.2 14.7 14.8 10.2 9.9 3.5 -0.1 0.2 -2.2 1.1 [2,] 6.4 10.9 9.1 17.0 13.6 12.7 9.5 -4.2 0.8 -1.9 6.2 -0.9 [3,] 9.6 12.9 9.0 13.7 12.6 16.0 8.6 -4.4 -2.4 -1.6 5.7 0.1 [4,] 13.2 15.9 17.4 9.5 8.9 10.4 10.0 -1.5 -1.2 -4.2 3.1 -4.0 [,26] [,27] [1,] -4.0 -3.6 [2,] -5.3 -3.5 [3,] -8.0 -5.1 [4,] -6.3 -3.3 > 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] 14.950 12.400 3.000 -13.550 -19.825 -7.450 13.850 28.900 17.425 [10] 5.775 -3.850 -1.050 1.275 8.750 12.575 11.925 13.725 12.475 [19] 12.325 9.500 -1.650 -0.725 -1.875 3.200 -0.925 -5.900 -3.875 > arr.sd [1] 1.6380883 1.8867962 6.3524274 5.9963878 3.1095284 6.3715514 [7] 10.9661601 2.7736859 3.8448017 4.6485661 0.5446712 1.1474610 [13] 2.2201727 3.4034296 2.4404576 3.9407064 3.1372759 2.5473843 [19] 2.6998457 0.6377042 3.6792209 1.3841363 1.8062392 3.8479432 [25] 2.2066188 1.6872068 0.8261356 > arr.range [1] 3.7 4.0 12.7 13.0 6.4 12.8 23.5 5.0 7.4 10.3 1.2 2.8 4.6 7.4 5.3 [16] 8.4 7.5 5.9 5.8 1.4 7.9 3.2 4.4 8.4 5.1 4.0 1.8 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 3.137048 0.008604 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 1.25396 -0.07151 Warning message: In log(arr.mean) : NaNs produced > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 6.75578 0.01231 > postscript(file="/var/yougetitorg/rcomp/tmp/1fnzg1305045441.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/yougetitorg/rcomp/tmp/29tuw1305045441.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/yougetitorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/yougetitorg/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/yougetitorg/rcomp/tmp/3gvms1305045441.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/yougetitorg/rcomp/tmp/4rkkf1305045441.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/yougetitorg/rcomp/tmp/5zoc31305045441.tab") > > try(system("convert tmp/1fnzg1305045441.ps tmp/1fnzg1305045441.png",intern=TRUE)) character(0) > try(system("convert tmp/29tuw1305045441.ps tmp/29tuw1305045441.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.630 0.320 0.839