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(1.1591,1.1203,1.0886,1.0701,1.0630,1.0377,1.0370,1.0605,1.0497,1.0706,1.0328,1.0110,1.0131,0.9834,0.9643,0.9449,0.9059,0.9505,0.9386,0.9045,0.8695,0.8525,0.8552,0.8983,0.9376,0.9205,0.9083,0.8925,0.8753,0.8530,0.8615,0.9014,0.9114,0.9050,0.8883,0.8912,0.8832,0.8707,0.8766,0.8860,0.9170,0.9561,0.9935,0.9781,0.9806,0.9812,1.0013,1.0194,1.0622,1.0785,1.0797,1.0862,1.1556,1.1674,1.1365,1.1155,1.1267,1.1714,1.1710,1.2298,1.2638,1.2640,1.2261,1.1989,1.2000,1.2146,1.2266,1.2191,1.2224,1.2507,1.2997,1.3406,1.3123,1.3013,1.3185,1.2943,1.2697,1.2155,1.2041,1.2295,1.2234,1.2022,1.1789,1.1861,1.2126,1.1940,1.2028,1.2273,1.2767,1.2661,1.2681,1.2810,1.2722,1.2617,1.2888,1.3205,1.2993,1.3080,1.3246,1.3513,1.3518,1.3421,1.3726,1.3626,1.3910,1.4233,1.4683,1.4559,1.4728,1.4759,1.5520,1.5754,1.5554,1.5562,1.5759,1.4955,1.4342,1.3266,1.2744,1.3511,1.3244,1.2797,1.3050,1.3199,1.3646,1.4014,1.4092,1.4266,1.4575,1.4821,1.4908,1.4579) > 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] 132 > (np <- floor(n / par1)) [1] 33 > 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,] 1.1591 1.0630 1.0497 1.0131 0.9059 0.8695 0.9376 0.8753 0.9114 0.8832 [2,] 1.1203 1.0377 1.0706 0.9834 0.9505 0.8525 0.9205 0.8530 0.9050 0.8707 [3,] 1.0886 1.0370 1.0328 0.9643 0.9386 0.8552 0.9083 0.8615 0.8883 0.8766 [4,] 1.0701 1.0605 1.0110 0.9449 0.9045 0.8983 0.8925 0.9014 0.8912 0.8860 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 0.9170 0.9806 1.0622 1.1556 1.1267 1.2638 1.2000 1.2224 1.3123 1.2697 [2,] 0.9561 0.9812 1.0785 1.1674 1.1714 1.2640 1.2146 1.2507 1.3013 1.2155 [3,] 0.9935 1.0013 1.0797 1.1365 1.1710 1.2261 1.2266 1.2997 1.3185 1.2041 [4,] 0.9781 1.0194 1.0862 1.1155 1.2298 1.1989 1.2191 1.3406 1.2943 1.2295 [,21] [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [1,] 1.2234 1.2126 1.2767 1.2722 1.2993 1.3518 1.3910 1.4728 1.5554 1.4342 [2,] 1.2022 1.1940 1.2661 1.2617 1.3080 1.3421 1.4233 1.4759 1.5562 1.3266 [3,] 1.1789 1.2028 1.2681 1.2888 1.3246 1.3726 1.4683 1.5520 1.5759 1.2744 [4,] 1.1861 1.2273 1.2810 1.3205 1.3513 1.3626 1.4559 1.5754 1.4955 1.3511 [,31] [,32] [,33] [1,] 1.3244 1.3646 1.4575 [2,] 1.2797 1.4014 1.4821 [3,] 1.3050 1.4092 1.4908 [4,] 1.3199 1.4266 1.4579 > 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] 1.109525 1.049550 1.041025 0.976425 0.924875 0.868875 0.914725 0.872800 [9] 0.898975 0.879125 0.961175 0.995625 1.076650 1.143750 1.174725 1.238200 [17] 1.215075 1.278350 1.306600 1.229700 1.197650 1.209175 1.272975 1.285800 [25] 1.320800 1.357275 1.434625 1.519025 1.545750 1.346575 1.307250 1.400450 [33] 1.472075 > arr.sd [1] 0.039012680 0.014127161 0.025292209 0.029066289 0.023239388 0.020987040 [7] 0.019077452 0.021165538 0.011031583 0.006861183 0.033209173 0.018540833 [13] 0.010209962 0.022733016 0.042287065 0.031685433 0.011202790 0.052363505 [19] 0.010854799 0.028618409 0.019737697 0.014273139 0.007054727 0.025683068 [25] 0.022882162 0.013209435 0.034727643 0.052478591 0.034815753 0.066600419 [31] 0.020151179 0.026118384 0.016975350 > arr.range [1] 0.0890 0.0260 0.0596 0.0682 0.0460 0.0458 0.0451 0.0484 0.0231 0.0153 [11] 0.0765 0.0388 0.0240 0.0519 0.1031 0.0651 0.0266 0.1182 0.0242 0.0656 [21] 0.0445 0.0333 0.0149 0.0588 0.0520 0.0305 0.0773 0.1026 0.0804 0.1598 [31] 0.0447 0.0620 0.0333 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -0.003247 0.024041 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -3.9746 0.9653 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -0.005228 0.052212 > postscript(file="/var/www/html/rcomp/tmp/1dl881274107602.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/2dl881274107602.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/3g4ow1274107602.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/425nk1274107602.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/555l81274107602.tab") > > try(system("convert tmp/1dl881274107602.ps tmp/1dl881274107602.png",intern=TRUE)) character(0) > try(system("convert tmp/2dl881274107602.ps tmp/2dl881274107602.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.515 0.288 0.805