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(1567,2237,2598,3729,5715,5776,5852,6878,5488,3583,2054,2282,1552,2261,2446,3519,5161,5085,5711,6057,5224,3363,1899,2115,1491,2061,2419,3430,4778,4862,6176,5664,5529,3418,1941,2402,1579,2146,2462,3695,4831,5134,6250,5760,6249,2917,1741,2359,1511,2059,2635,2867,4403,5720,4502,5749,5627,2846,1762,2429,1169,2154,2249,2687,4359,5382,4459,6398,4596,3024,1887,2070,1351,2218,2461,3028,4784,4975,4607,6249,4809,3157,1910,2228,1673,2589,2332,3785,4916,5207,6055,5751,5247,3387,2091,2401,1664,2205,2295,3762,4890,5117,6099,5865,5594,3229,2106,2410,1583,2092,2612,3665,4880,5875,5892,6078,6515,3164,2028,2677,1580,2196,2838,3087,4726,6521,6739,5943,6265,3323,2098,2544,1442,2307,2811,3461,5451,5481,5114,8381,5215,3700,2122,2311,1515,2351,2289,3380,5398,5242,5162,6391,5958,3727,1883,2191) > 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] 156 > (np <- floor(n / par1)) [1] 13 > 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,] 1567 1552 1491 1579 1511 1169 1351 1673 1664 1583 1580 1442 1515 [2,] 2237 2261 2061 2146 2059 2154 2218 2589 2205 2092 2196 2307 2351 [3,] 2598 2446 2419 2462 2635 2249 2461 2332 2295 2612 2838 2811 2289 [4,] 3729 3519 3430 3695 2867 2687 3028 3785 3762 3665 3087 3461 3380 [5,] 5715 5161 4778 4831 4403 4359 4784 4916 4890 4880 4726 5451 5398 [6,] 5776 5085 4862 5134 5720 5382 4975 5207 5117 5875 6521 5481 5242 [7,] 5852 5711 6176 6250 4502 4459 4607 6055 6099 5892 6739 5114 5162 [8,] 6878 6057 5664 5760 5749 6398 6249 5751 5865 6078 5943 8381 6391 [9,] 5488 5224 5529 6249 5627 4596 4809 5247 5594 6515 6265 5215 5958 [10,] 3583 3363 3418 2917 2846 3024 3157 3387 3229 3164 3323 3700 3727 [11,] 2054 1899 1941 1741 1762 1887 1910 2091 2106 2028 2098 2122 1883 [12,] 2282 2115 2402 2359 2429 2070 2228 2401 2410 2677 2544 2311 2191 > 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] 3979.917 3699.417 3680.917 3760.250 3509.167 3369.500 3481.417 3786.167 [9] 3769.667 3921.750 3988.333 3983.000 3790.583 > arr.sd [1] 1858.556 1655.135 1650.877 1789.635 1598.461 1621.986 1541.659 1578.330 [9] 1656.403 1816.556 1925.404 1995.202 1755.683 > arr.range [1] 5311 4505 4685 4671 4238 5229 4898 4382 4435 4932 5159 6939 4876 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -464.0468 0.5845 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -2.598 1.221 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -349.095 1.412 > postscript(file="/var/www/rcomp/tmp/1jsfc1293627458.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/2jsfc1293627458.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/35svi1293627458.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/4qtun1293627458.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/5tbab1293627458.tab") > > try(system("convert tmp/1jsfc1293627458.ps tmp/1jsfc1293627458.png",intern=TRUE)) character(0) > try(system("convert tmp/2jsfc1293627458.ps tmp/2jsfc1293627458.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.600 0.400 0.983