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(771.28,766.78,757.59,747.73,746.59,744.5,744.29,743.79,738.89,736.74,732.77,731.58,731.48,730.08,724.19,716.81,714.84,713.18,713.16,713.15,713.6,707.08,704.11,704.36,704.36,701.93,696.44,686.58,684.48,683.74,683.7,683.52,678.77,674.71,670.28,668.85,668.85,669.35,672.28,671.6,671.96,671.18,671.18,681.14,682.23,679.98,679.69,679.69,679.7,681.21,672.32,669.98,667.91,666.04,666.04,666.27,664.45,660.76,660.4,660.69,660.69,662.23,661.41,659.02,655.43,652.59,652.59,648.2,645.84,644.67,642.71,640.14,640.14,639.64,630.28,614.57,614.7,615.08,615.08,614.43,604.55,598.98,594.05,593.05,593.05,593.34,584.72,580.7,577.08,569.92,569.92,568.86,559.38,548.22,545.61,545.33) > 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] 96 > (np <- floor(n / par1)) [1] 24 > 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,] 771.28 746.59 738.89 731.48 714.84 713.60 704.36 684.48 678.77 668.85 [2,] 766.78 744.50 736.74 730.08 713.18 707.08 701.93 683.74 674.71 669.35 [3,] 757.59 744.29 732.77 724.19 713.16 704.11 696.44 683.70 670.28 672.28 [4,] 747.73 743.79 731.58 716.81 713.15 704.36 686.58 683.52 668.85 671.60 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 671.96 682.23 679.70 667.91 664.45 660.69 655.43 645.84 640.14 614.70 [2,] 671.18 679.98 681.21 666.04 660.76 662.23 652.59 644.67 639.64 615.08 [3,] 671.18 679.69 672.32 666.04 660.40 661.41 652.59 642.71 630.28 615.08 [4,] 681.14 679.69 669.98 666.27 660.69 659.02 648.20 640.14 614.57 614.43 [,21] [,22] [,23] [,24] [1,] 604.55 593.05 577.08 559.38 [2,] 598.98 593.34 569.92 548.22 [3,] 594.05 584.72 569.92 545.61 [4,] 593.05 580.70 568.86 545.33 > 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] 760.8450 744.7925 734.9950 725.6400 713.5825 707.2875 697.3275 683.8600 [9] 673.1525 670.5200 673.8650 680.3975 675.8025 666.5650 661.5750 660.8375 [17] 652.2025 643.3400 631.1575 614.8225 597.6575 587.9525 571.4450 549.6350 > arr.sd [1] 10.4357031 1.2347841 3.4072912 6.6805838 0.8384261 4.4180492 [7] 7.8937839 0.4242641 4.4998102 1.6754900 4.8639182 1.2292918 [13] 5.4912316 0.9031980 1.9229925 1.3652686 2.9853573 2.4937121 [19] 11.9520330 0.3171093 5.2756887 6.2731564 3.7897537 6.6257301 > arr.range [1] 23.55 2.80 7.31 14.67 1.69 9.49 17.78 0.96 9.92 3.43 9.96 2.54 [13] 11.23 1.87 4.05 3.21 7.23 5.70 25.57 0.65 11.50 12.64 8.22 14.05 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 5.614860 -0.002363 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 7.427 -0.985 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 10.124626 -0.002063 > postscript(file="/var/www/rcomp/tmp/15wqt1291842867.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/25wqt1291842867.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/3j6nk1291842867.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/4m7m71291842867.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/5q7kv1291842867.tab") > > try(system("convert tmp/15wqt1291842867.ps tmp/15wqt1291842867.png",intern=TRUE)) character(0) > try(system("convert tmp/25wqt1291842867.ps tmp/25wqt1291842867.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.600 0.190 0.778