R version 2.12.2 (2011-02-25) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-redhat-linux-gnu (64-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(112,118,129,99,116,168,118,129,205,147,150,267,126,129,124,97,102,127,222,214,118,141,154,226,89,77,82,97,127,121,117,117,106,112,134,169,75,108,115,85,101,108,109,124,105,95,135,164,88,85,112,87,91,87,87,142,95,108,139,159,61,82,124,93,108,75,87,103,90,108,123,129,57,65,67,71,76,67,110,118,99,85,107,141,58,65,70,86,93,74,87,73,101,100,96,157,63,115,70,66,67,83,79,77,102,116,100,135,71,60,89,74,73,91,86,74,87,87,109,137,43,69,73,77,69,76,78,70,83,65,110,132,54,55,66,65,60,65,96,55,71,63,74,106,34,47,56,53,53,55,67,52,46,51,58,91,33,40,46,45,41,55,57,54,46,52,48,77,30,35,42,48,44,45,0,0,46,51,63,84,30,39,45,52,28,40,62) > 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] 187 > (np <- floor(n / par1)) [1] 46 > 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] [,13] [,14] [1,] 112 116 205 126 102 118 89 127 106 75 101 105 88 91 [2,] 118 168 147 129 127 141 77 121 112 108 108 95 85 87 [3,] 129 118 150 124 222 154 82 117 134 115 109 135 112 87 [4,] 99 129 267 97 214 226 97 117 169 85 124 164 87 142 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 95 61 108 90 57 76 99 58 93 101 63 67 [2,] 108 82 75 108 65 67 85 65 74 100 115 83 [3,] 139 124 87 123 67 110 107 70 87 96 70 79 [4,] 159 93 103 129 71 118 141 86 73 157 66 77 [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [,38] [1,] 102 71 73 87 43 69 83 54 60 71 34 53 [2,] 116 60 91 87 69 76 65 55 65 63 47 55 [3,] 100 89 86 109 73 78 110 66 96 74 56 67 [4,] 135 74 74 137 77 70 132 65 55 106 53 52 [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46] [1,] 46 33 41 46 30 44 46 30 [2,] 51 40 55 52 35 45 51 39 [3,] 58 46 57 48 42 0 63 45 [4,] 91 45 54 77 48 0 84 52 > 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] 114.50 132.75 192.25 119.00 166.25 159.75 86.25 120.50 130.25 95.75 [11] 110.50 124.75 93.00 101.75 125.25 90.00 93.25 112.50 65.00 92.75 [21] 108.00 69.75 81.75 113.50 78.50 76.50 113.25 73.50 81.00 105.00 [31] 65.50 73.25 97.50 60.00 69.00 78.50 47.50 56.75 61.50 41.00 [41] 51.75 55.75 38.75 22.25 61.00 41.50 > arr.sd [1] 12.503333 24.185050 56.517696 14.809907 60.709005 46.607403 8.693868 [8] 4.725816 28.500000 18.856917 9.678154 31.202297 12.727922 26.899504 [15] 29.101833 26.267851 15.107945 17.406895 5.887841 25.024988 23.804761 [22] 11.898879 9.844626 29.080348 24.501701 6.806859 16.152915 11.958261 [29] 8.906926 23.720596 15.351439 4.425306 29.512709 6.377042 18.457158 [36] 18.912077 9.746794 6.946222 20.273135 5.944185 7.274384 14.384598 [43] 7.889867 25.695330 16.911535 9.327379 > arr.range [1] 30 52 120 32 120 108 20 10 63 40 23 69 27 55 64 63 33 39 14 [20] 51 56 28 20 61 52 16 35 29 18 50 34 9 67 12 41 43 22 15 [39] 45 13 16 31 18 45 38 22 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -4.2728 0.2546 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -0.7853 0.7947 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -9.0293 0.5507 > postscript(file="/var/www/wessaorg/rcomp/tmp/1d1n11304684114.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/www/wessaorg/rcomp/tmp/2za411304684114.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/www/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/wessaorg/rcomp/tmp/3sem51304684114.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/wessaorg/rcomp/tmp/46xys1304684114.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/wessaorg/rcomp/tmp/5uhkj1304684115.tab") > > try(system("convert tmp/1d1n11304684114.ps tmp/1d1n11304684114.png",intern=TRUE)) character(0) > try(system("convert tmp/2za411304684114.ps tmp/2za411304684114.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.460 0.210 1.707