R version 2.9.0 (2009-04-17) 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(-706.026542296181 + ,-59.4405579520267 + ,-969.833720383066 + ,1994.56903063601 + ,102.064814516947 + ,1282.18411025837 + ,-307.754606959943 + ,225.069461418321 + ,-862.471322666482 + ,-2850.16172979440 + ,-3875.76341994283 + ,2996.98129088558 + ,1931.51753614196 + ,488.179241950267 + ,-601.581627830989 + ,-3495.10356420977 + ,265.163825175723 + ,640.313274555833 + ,-3418.45097379814 + ,2072.03398243007 + ,2662.9984145817 + ,-1064.81719671349 + ,-9.57987333730985 + ,-2208.8867746199 + ,-4275.21498681124 + ,381.837227886395 + ,1914.99171248840 + ,1019.08609621188 + ,884.745394297871 + ,-1702.08983953302 + ,-2064.71644375347 + ,-2452.89205796152 + ,1313.39939683182 + ,-569.737683944086 + ,-187.9171774845 + ,-128.334928612711 + ,-2601.14827891639 + ,581.657297679053 + ,-299.792761503996 + ,2868.57371158154 + ,2723.0124492194 + ,-1846.18418996859 + ,-6526.92686969168 + ,-3652.78139505582 + ,2790.5729463211 + ,-7703.28365973859 + ,-1373.42544129638 + ,-2976.48819823291 + ,5585.1945937738 + ,-2568.07437379205 + ,-4750.48266905558 + ,1324.51875012340 + ,-1689.96832952026 + ,-7068.09981170815 + ,1855.55513995599 + ,2269.56153308754 + ,-4661.24493442205 + ,3260.97170059017 + ,2160.39821896397 + ,4793.18303923311 + ,-2209.06420471032 + ,-2213.50510931699 + ,-3114.14394163762 + ,3411.46075067066 + ,-4693.81993673823 + ,5920.52037235391 + ,-2077.91680939984 + ,-3642.83868232441 + ,332.648590721953 + ,2734.67402718683 + ,7903.1305482291 + ,5491.06198558059 + ,4354.83029956606 + ,1619.51905250655 + ,5543.22938817069 + ,-366.008933224093 + ,-3459.03179080274 + ,1134.72876550400 + ,-2525.56367971036 + ,-926.76612281528 + ,-2956.34221718809 + ,-885.143314774538) > 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] 82 > (np <- floor(n / par1)) [1] 6 > 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] [1,] -706.02654 1931.517536 -4275.2150 -2601.1483 5585.195 -2209.0642 [2,] -59.44056 488.179242 381.8372 581.6573 -2568.074 -2213.5051 [3,] -969.83372 -601.581628 1914.9917 -299.7928 -4750.483 -3114.1439 [4,] 1994.56903 -3495.103564 1019.0861 2868.5737 1324.519 3411.4608 [5,] 102.06481 265.163825 884.7454 2723.0124 -1689.968 -4693.8199 [6,] 1282.18411 640.313275 -1702.0898 -1846.1842 -7068.100 5920.5204 [7,] -307.75461 -3418.450974 -2064.7164 -6526.9269 1855.555 -2077.9168 [8,] 225.06946 2072.033982 -2452.8921 -3652.7814 2269.562 -3642.8387 [9,] -862.47132 2662.998415 1313.3994 2790.5729 -4661.245 332.6486 [10,] -2850.16173 -1064.817197 -569.7377 -7703.2837 3260.972 2734.6740 [11,] -3875.76342 -9.579873 -187.9172 -1373.4254 2160.398 7903.1305 [12,] 2996.98129 -2208.886775 -128.3349 -2976.4882 4793.183 5491.0620 > 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] -252.54860 -228.18448 -488.90361 -1501.35120 42.62607 653.51730 > arr.sd [1] 1890.792 2033.493 1817.133 3477.390 4084.340 4273.208 > arr.range [1] 6872.745 6158.102 6190.207 10571.857 12653.294 12596.950 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 3060.6749 0.4438 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 8.25278 0.01656 Warning message: In log(arr.mean) : NaNs produced > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 9528.723 1.200 > postscript(file="/var/www/html/rcomp/tmp/1mde01260195346.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/html/rcomp/tmp/2i0nk1260195346.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/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/html/rcomp/tmp/3zqon1260195346.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/html/rcomp/tmp/4tj4p1260195346.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/html/rcomp/tmp/5uuep1260195346.tab") > > system("convert tmp/1mde01260195346.ps tmp/1mde01260195346.png") > system("convert tmp/2i0nk1260195346.ps tmp/2i0nk1260195346.png") > > > proc.time() user system elapsed 0.515 0.275 1.115