R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(1069.108 + ,1059.362 + ,1049.495 + ,1029.082 + ,1231.089 + ,1220.388 + ,1069.108 + ,968.521 + ,978.233 + ,978.233 + ,989.056 + ,1008.514 + ,1069.108 + ,1049.495 + ,1079.775 + ,1129.547 + ,1412.683 + ,1412.683 + ,1352.244 + ,1291.65 + ,1341.422 + ,1401.983 + ,1412.683 + ,1442.964 + ,1533.833 + ,1473.244 + ,1473.244 + ,1564.114 + ,1816.014 + ,1836.427 + ,1785.734 + ,1664.578 + ,1755.42 + ,1755.42 + ,1765.165 + ,1816.014 + ,1856.04 + ,1876.453 + ,1876.453 + ,1937.014 + ,2169.452 + ,2229.89 + ,2239.603 + ,2088.322 + ,2169.452 + ,2139.171 + ,2078.582 + ,2209.478 + ,2239.603 + ,2188.909 + ,2199.61 + ,2269.916 + ,2532.64 + ,2663.352 + ,2663.352 + ,2602.913 + ,2693.66 + ,2602.913 + ,2552.092 + ,2744.509 + ,2774.634 + ,2703.378 + ,2884.967 + ,2956.228 + ,3168.103 + ,3308.711 + ,3289.258 + ,3278.43 + ,3359.559 + ,3349.692 + ,3228.692 + ,3410.253 + ,3470.847 + ,3410.253 + ,3662.154 + ,3783.309 + ,4065.362 + ,4176.65 + ,4146.492 + ,4085.897 + ,4136.624 + ,4197.185 + ,3995.056 + ,4156.204 + ,4257.779 + ,4216.798 + ,4479.366 + ,4570.08 + ,4953.837 + ,5024.138 + ,4933.418 + ,4984.117 + ,5014.398 + ,5044.678 + ,4852.261 + ,5033.856 + ,5134.437 + ,5033.856 + ,5326.854 + ,5417.607 + ,5811.037 + ,5871.631 + ,5891.089 + ,5992.631 + ,5992.631 + ,6032.657 + ,5851.063 + ,5941.938 + ,6002.377 + ,5891.089 + ,6214.246 + ,6274.812 + ,6678.021 + ,6749.283 + ,6849.864 + ,6940.739 + ,6950.451 + ,6961.152 + ,6779.563 + ,6961.152) > 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] 120 > (np <- floor(n / par1)) [1] 10 > 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] [1,] 1069.108 1069.108 1533.833 1856.040 2239.603 2774.634 3470.847 4257.779 [2,] 1059.362 1049.495 1473.244 1876.453 2188.909 2703.378 3410.253 4216.798 [3,] 1049.495 1079.775 1473.244 1876.453 2199.610 2884.967 3662.154 4479.366 [4,] 1029.082 1129.547 1564.114 1937.014 2269.916 2956.228 3783.309 4570.080 [5,] 1231.089 1412.683 1816.014 2169.452 2532.640 3168.103 4065.362 4953.837 [6,] 1220.388 1412.683 1836.427 2229.890 2663.352 3308.711 4176.650 5024.138 [7,] 1069.108 1352.244 1785.734 2239.603 2663.352 3289.258 4146.492 4933.418 [8,] 968.521 1291.650 1664.578 2088.322 2602.913 3278.430 4085.897 4984.117 [9,] 978.233 1341.422 1755.420 2169.452 2693.660 3359.559 4136.624 5014.398 [10,] 978.233 1401.983 1755.420 2139.171 2602.913 3349.692 4197.185 5044.678 [11,] 989.056 1412.683 1765.165 2078.582 2552.092 3228.692 3995.056 4852.261 [12,] 1008.514 1442.964 1816.014 2209.478 2744.509 3410.253 4156.204 5033.856 [,9] [,10] [1,] 5134.437 6002.377 [2,] 5033.856 5891.089 [3,] 5326.854 6214.246 [4,] 5417.607 6274.812 [5,] 5811.037 6678.021 [6,] 5871.631 6749.283 [7,] 5891.089 6849.864 [8,] 5992.631 6940.739 [9,] 5992.631 6950.451 [10,] 6032.657 6961.152 [11,] 5851.063 6779.563 [12,] 5941.938 6961.152 > 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] 1054.182 1283.020 1686.601 2072.492 2496.122 3142.659 3940.503 4780.394 [9] 5691.453 6604.396 > arr.sd [1] 88.03211 154.80303 138.59149 146.80536 209.58710 246.17696 284.87765 [8] 312.47422 359.70927 397.36149 > arr.range [1] 262.568 393.469 363.183 383.563 555.600 706.875 786.932 827.880 [9] 998.801 1070.063 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 60.28813 0.05299 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -0.5602 0.7465 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 158.9627 0.1453 > postscript(file="/var/wessaorg/rcomp/tmp/1y4ze1312904408.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/wessaorg/rcomp/tmp/2xvss1312904408.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/3252t1312904408.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/wessaorg/rcomp/tmp/4ucr21312904408.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/wessaorg/rcomp/tmp/51ra11312904408.tab") > > try(system("convert tmp/1y4ze1312904408.ps tmp/1y4ze1312904408.png",intern=TRUE)) character(0) > try(system("convert tmp/2xvss1312904408.ps tmp/2xvss1312904408.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.653 0.127 0.772