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(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 = '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] [1,] 1.1591 1.0131 0.9376 0.8832 1.0622 1.2638 1.3123 1.2126 1.2993 1.4728 [2,] 1.1203 0.9834 0.9205 0.8707 1.0785 1.2640 1.3013 1.1940 1.3080 1.4759 [3,] 1.0886 0.9643 0.9083 0.8766 1.0797 1.2261 1.3185 1.2028 1.3246 1.5520 [4,] 1.0701 0.9449 0.8925 0.8860 1.0862 1.1989 1.2943 1.2273 1.3513 1.5754 [5,] 1.0630 0.9059 0.8753 0.9170 1.1556 1.2000 1.2697 1.2767 1.3518 1.5554 [6,] 1.0377 0.9505 0.8530 0.9561 1.1674 1.2146 1.2155 1.2661 1.3421 1.5562 [7,] 1.0370 0.9386 0.8615 0.9935 1.1365 1.2266 1.2041 1.2681 1.3726 1.5759 [8,] 1.0605 0.9045 0.9014 0.9781 1.1155 1.2191 1.2295 1.2810 1.3626 1.4955 [9,] 1.0497 0.8695 0.9114 0.9806 1.1267 1.2224 1.2234 1.2722 1.3910 1.4342 [10,] 1.0706 0.8525 0.9050 0.9812 1.1714 1.2507 1.2022 1.2617 1.4233 1.3266 [11,] 1.0328 0.8552 0.8883 1.0013 1.1710 1.2997 1.1789 1.2888 1.4683 1.2744 [12,] 1.0110 0.8983 0.8912 1.0194 1.2298 1.3406 1.1861 1.3205 1.4559 1.3511 [,11] [1,] 1.3244 [2,] 1.2797 [3,] 1.3050 [4,] 1.3199 [5,] 1.3646 [6,] 1.4014 [7,] 1.4092 [8,] 1.4266 [9,] 1.4575 [10,] 1.4821 [11,] 1.4908 [12,] 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.0667000 0.9233917 0.8955000 0.9453083 1.1317083 1.2438750 1.2446500 [8] 1.2559833 1.3709000 1.4704500 1.3932583 > arr.sd [1] 0.04071299 0.05101099 0.02409968 0.05488506 0.04984987 0.04244237 [7] 0.05139904 0.03839320 0.05455471 0.10388097 0.07309650 > arr.range [1] 0.1481 0.1606 0.0846 0.1487 0.1676 0.1417 0.1396 0.1265 0.1690 0.3015 [11] 0.2111 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -0.02777 0.06876 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -3.200 1.354 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -0.05489 0.18566 > postscript(file="/var/www/rcomp/tmp/1jd3a1274970497.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/rcomp/tmp/2jd3a1274970497.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/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/3nejy1274970497.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/4qehm1274970497.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/5tfga1274970497.tab") > try(system("convert tmp/1jd3a1274970497.ps tmp/1jd3a1274970497.png",intern=TRUE)) character(0) > try(system("convert tmp/2jd3a1274970497.ps tmp/2jd3a1274970497.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.590 0.480 0.986