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(161949,161634,161287,160652,167176,166856,161949,158687,159007,159007,159323,159990,159990,157043,155745,157043,161634,160967,154763,149510,148527,146563,147892,149510,148874,147545,144950,147545,149856,149190,141656,138394,135132,132505,132190,134150,131523,130541,129559,135132,135768,132505,123670,119745,113541,110910,112208,114172,114172,112559,112208,117465,121710,119745,113190,109932,103061,98817,102079,105341,105341,101097,100781,106319,109932,108630,102079,97835,88652,85075,86372,91946,92261,84092,87039,94226,97488,95523,86692,80484,73297,67724,70004,74910,73613,66426,68706,75893,79821,77541,68706,64782,58893,52684,53666,58573,59208,53319,54302,62502,64462,61173,49075,42871,34671,26502,29129,32706,32075,25835,29444,38280,42204,40244,32391,26186,19631,12093,13427,15707) > 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] 120 > (np <- floor(n / par1)) [1] 30 > 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,] 161949 167176 159007 159990 161634 148527 148874 149856 135132 131523 [2,] 161634 166856 159007 157043 160967 146563 147545 149190 132505 130541 [3,] 161287 161949 159323 155745 154763 147892 144950 141656 132190 129559 [4,] 160652 158687 159990 157043 149510 149510 147545 138394 134150 135132 [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] 135768 113541 114172 121710 103061 105341 109932 88652 92261 97488 73297 [2,] 132505 110910 112559 119745 98817 101097 108630 85075 84092 95523 67724 [3,] 123670 112208 112208 113190 102079 100781 102079 86372 87039 86692 70004 [4,] 119745 114172 117465 109932 105341 106319 97835 91946 94226 80484 74910 [,22] [,23] [,24] [,25] [,26] [,27] [,28] [,29] [,30] [1,] 73613 79821 58893 59208 64462 34671 32075 42204 19631 [2,] 66426 77541 52684 53319 61173 26502 25835 40244 12093 [3,] 68706 68706 53666 54302 49075 29129 29444 32391 13427 [4,] 75893 64782 58573 62502 42871 32706 38280 26186 15707 > 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] 161380.50 163667.00 159331.75 157455.25 156718.50 148123.00 147228.50 [8] 144774.00 133494.25 131688.75 127922.00 112707.75 114101.00 116144.25 [15] 102324.50 103384.50 104619.00 88011.25 89404.50 90046.75 71483.75 [22] 71159.50 72712.50 55954.00 57332.75 54395.25 30752.00 31408.50 [29] 35256.25 15214.50 > arr.sd [1] 555.8504 4092.0543 463.4274 1797.2027 5715.4278 1234.7666 [7] 1643.1248 5649.6048 1389.4743 2431.5022 7472.3142 1451.4348 [13] 2400.1910 5515.5120 2708.2917 2854.8235 5680.0923 3011.1749 [19] 4662.7853 7917.5344 3232.7720 4353.2122 7136.5271 3236.4964 [25] 4302.4544 10138.8814 3645.6964 5246.7418 7385.3001 3300.8558 > arr.range [1] 1297 8489 983 4245 12124 2947 3924 11462 2942 5573 16023 3262 [13] 5257 11778 6524 5538 12097 6871 10134 17004 7186 9467 15039 6209 [25] 9183 21591 8169 12445 16018 7538 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 6277.69035 -0.02221 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) 13.8832 -0.5092 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 1.375e+04 -4.958e-02 > postscript(file="/var/wessaorg/rcomp/tmp/190721312201344.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/2280t1312201344.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/382it1312201344.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/4k03z1312201344.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/5p7nw1312201344.tab") > > try(system("convert tmp/190721312201344.ps tmp/190721312201344.png",intern=TRUE)) character(0) > try(system("convert tmp/2280t1312201344.ps tmp/2280t1312201344.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.650 0.127 0.768