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(52347,52407,50570,50442,50590,50040,50476,50268,50595,48708,48547,48196,48375,47915,46462,46132,46308,46532,46817,46824,46263,45992,46404,46995,48102,48719,47912,48430,50141,50608,51005,51857,52513,52406,53634,55165,57294,58026,56701,58706,60103,61153,62395,63850,64534,65765,66954,65741,65474,60687,59227,59373,59995,59532,59696,59507,60210,58782,59372,58827,60481,59508,56565,56201,56193,56431,56316,55316,54795,53310,51848,50618,52026,50120,46825,46374,45441,45392,45032,44302,42880,42101,41886,41415,43228,41633,39375,38603,37847,36881,36700,36477,35684,35896,37109,37612,39570,39518,37970,38343,37966,38942,39304,39438,38999,38110,40024,41050,42239,42313,41159,42067,42515,43554,45018,45797,46749,47291,48800,50566,54884,54002,51813,52751,54461,55364,56900,57795) > 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] 128 > (np <- floor(n / par1)) [1] 32 > 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] [1,] 52347 50590 50595 48375 46308 46263 48102 50141 52513 57294 60103 64534 [2,] 52407 50040 48708 47915 46532 45992 48719 50608 52406 58026 61153 65765 [3,] 50570 50476 48547 46462 46817 46404 47912 51005 53634 56701 62395 66954 [4,] 50442 50268 48196 46132 46824 46995 48430 51857 55165 58706 63850 65741 [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [1,] 65474 59995 60210 60481 56193 54795 52026 45441 42880 43228 37847 35684 [2,] 60687 59532 58782 59508 56431 53310 50120 45392 42101 41633 36881 35896 [3,] 59227 59696 59372 56565 56316 51848 46825 45032 41886 39375 36700 37109 [4,] 59373 59507 58827 56201 55316 50618 46374 44302 41415 38603 36477 37612 [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [1,] 39570 37966 38999 42239 42515 46749 54884 54461 [2,] 39518 38942 38110 42313 43554 47291 54002 55364 [3,] 37970 39304 40024 41159 45018 48800 51813 56900 [4,] 38343 39438 41050 42067 45797 50566 52751 57795 > 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] 51441.50 50343.50 49011.50 47221.00 46620.25 46413.50 48290.75 50902.75 [9] 53429.50 57681.75 61875.25 65748.50 61190.25 59682.50 59297.75 58188.75 [17] 56064.00 52642.75 48836.25 45041.75 42070.50 40709.75 36976.25 36575.25 [25] 38850.25 38912.50 39545.75 41944.50 44221.00 48351.50 53362.50 56130.00 > arr.sd [1] 1081.7629 242.3022 1077.0925 1091.6889 248.6716 423.6921 356.7757 [8] 727.5962 1283.3946 871.7448 1615.7860 988.0231 2930.3312 224.5655 [15] 664.6595 2127.7958 508.0479 1808.1890 2703.7209 525.8012 610.9940 [22] 2114.5470 603.5569 933.7107 815.6945 664.8697 1271.7186 533.7100 [29] 1469.0484 1712.4864 1353.8593 1498.6040 > arr.range [1] 1965 550 2399 2243 516 1003 807 1716 2759 2005 3747 2420 6247 488 1428 [16] 4280 1115 4177 5652 1139 1465 4625 1370 1928 1600 1472 2940 1154 3282 3817 [31] 3071 3334 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 103.48738 0.02001 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 0.01225 0.62783 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 147.60433 0.04535 > postscript(file="/var/yougetitorg/rcomp/tmp/1viqu1295183430.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/yougetitorg/rcomp/tmp/2m2hc1295183430.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/yougetitorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/yougetitorg/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/yougetitorg/rcomp/tmp/3kb7h1295183430.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/yougetitorg/rcomp/tmp/45tpu1295183430.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/yougetitorg/rcomp/tmp/5hnnb1295183430.tab") > > try(system("convert tmp/1viqu1295183430.ps tmp/1viqu1295183430.png",intern=TRUE)) character(0) > try(system("convert tmp/2m2hc1295183430.ps tmp/2m2hc1295183430.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.720 0.440 0.928