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(90604,97527,111940,100280,100009,95558,98533,92694,97920,110933,110855,111716,96348,105425,114874,104199,101166,99010,101607,97492,106088,113536,112475,115491,97733,102591,114783,100397,97772,96128,91261,90686,97792,108848,109989,109453,93945,98750,119043,104776,103262,106735,101600,99358,105240,114079,121637,111747,99496,104992,124255,108258,106940,104939,105896,107287,110783,122139,125823,120480,103296,117121,129924,118589,118062,113597,117161,112893,119657,136562,140446,138744,120324,118113,130257,125510,117986,118316,122075,117573,122566,135934,138394,137999,118780,117907,142932,132200,125666,127958,127718,124368,135241,144734,142320,141481,120471,123422,145829,134572,132156,140265,137771,134035,144016,151905,155791,148440,129862,134264,151952,143191,137242,136993,134431,132523,133486,140120,137521,112193,94256,99047,109761,102160,104792,104341,112430,113034,114197,127876,135199,123663,112578,117104,139703,114961,134222,128390,134197,135963,135936,146803,143231,131510) > 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] 144 > (np <- floor(n / par1)) [1] 12 > 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,] 90604 96348 97733 93945 99496 103296 120324 118780 120471 129862 [2,] 97527 105425 102591 98750 104992 117121 118113 117907 123422 134264 [3,] 111940 114874 114783 119043 124255 129924 130257 142932 145829 151952 [4,] 100280 104199 100397 104776 108258 118589 125510 132200 134572 143191 [5,] 100009 101166 97772 103262 106940 118062 117986 125666 132156 137242 [6,] 95558 99010 96128 106735 104939 113597 118316 127958 140265 136993 [7,] 98533 101607 91261 101600 105896 117161 122075 127718 137771 134431 [8,] 92694 97492 90686 99358 107287 112893 117573 124368 134035 132523 [9,] 97920 106088 97792 105240 110783 119657 122566 135241 144016 133486 [10,] 110933 113536 108848 114079 122139 136562 135934 144734 151905 140120 [11,] 110855 112475 109989 121637 125823 140446 138394 142320 155791 137521 [12,] 111716 115491 109453 111747 120480 138744 137999 141481 148440 112193 [,11] [,12] [1,] 94256 112578 [2,] 99047 117104 [3,] 109761 139703 [4,] 102160 114961 [5,] 104792 134222 [6,] 104341 128390 [7,] 112430 134197 [8,] 113034 135963 [9,] 114197 135936 [10,] 127876 146803 [11,] 135199 143231 [12,] 123663 131510 > 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] 101547.4 105642.6 101452.8 106681.0 111774.0 122171.0 125420.6 131775.4 [9] 139056.1 135314.8 111729.7 131216.5 > arr.sd [1] 7760.754 6919.447 7749.488 8414.506 8899.619 11592.896 8126.876 [8] 9507.965 10827.387 9296.594 12160.123 11040.834 > arr.range [1] 21336 19143 24097 27692 26327 37150 20821 26827 35320 39759 40943 34225 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 1.745e+03 6.416e-02 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -1.159 0.881 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -5564.8533 0.2953 > postscript(file="/var/wessaorg/rcomp/tmp/113801324419379.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/2txq51324419379.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/3ur1k1324419379.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/47an01324419379.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/50b341324419379.tab") > > try(system("convert tmp/113801324419379.ps tmp/113801324419379.png",intern=TRUE)) character(0) > try(system("convert tmp/2txq51324419379.ps tmp/2txq51324419379.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.741 0.181 0.930