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(465,455,444,424,630,620,465,362,372,372,382,403,434,424,362,372,661,723,558,465,486,496,548,599,610,506,517,382,765,878,620,537,589,651,744,858,858,785,754,568,878,1023,899,765,785,858,961,1085,1002,951,951,785,1023,1178,1054,920,961,1126,1199,1302,1219,1085,1054,806,971,1147,951,837,951,1064,1126,1292,1209,1002,1023,827,992,1137,971,858,961,1085,1064,1312,1271,1106,1116,899,1033,1240,1085,992,1147,1240,1168,1498,1416,1230,1178,940,1075,1199,1044,1044,1219,1312,1261,1622,1529,1354,1281,1023,1116,1281,1157,1126,1271,1395,1261,1581) > 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] [,11] [,12] [,13] [,14] [1,] 465 630 372 434 661 486 610 765 589 858 878 785 1002 1023 [2,] 455 620 372 424 723 496 506 878 651 785 1023 858 951 1178 [3,] 444 465 382 362 558 548 517 620 744 754 899 961 951 1054 [4,] 424 362 403 372 465 599 382 537 858 568 765 1085 785 920 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [1,] 961 1219 971 951 1209 992 961 1271 1033 1147 1416 1075 [2,] 1126 1085 1147 1064 1002 1137 1085 1106 1240 1240 1230 1199 [3,] 1199 1054 951 1126 1023 971 1064 1116 1085 1168 1178 1044 [4,] 1302 806 837 1292 827 858 1312 899 992 1498 940 1044 [,27] [,28] [,29] [,30] [1,] 1219 1529 1116 1271 [2,] 1312 1354 1281 1395 [3,] 1261 1281 1157 1261 [4,] 1622 1023 1126 1581 > 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] 447.00 519.25 382.25 398.00 601.75 532.25 503.75 700.00 710.50 [10] 741.25 891.25 922.25 922.25 1043.75 1147.00 1041.00 976.50 1108.25 [19] 1015.25 989.50 1105.50 1098.00 1087.50 1263.25 1191.00 1090.50 1353.50 [28] 1296.75 1170.00 1377.00 > arr.sd [1] 17.56891 129.21139 14.61449 36.25833 113.76401 52.14323 93.61757 [8] 151.52338 117.16228 123.45411 105.72409 130.32619 94.60576 106.25873 [15] 143.48751 172.25369 128.07680 142.31977 156.21860 114.59639 147.94706 [22] 152.66303 108.55567 161.48762 196.05781 73.79476 182.99454 210.08312 [29] 76.03070 149.03243 > arr.range [1] 41 268 31 72 258 113 228 341 269 290 258 300 217 258 341 413 310 341 382 [20] 279 351 372 248 351 476 155 403 506 165 320 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean 13.3108 0.1159 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -3.787 1.248 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean 25.4201 0.2749 > postscript(file="/var/wessaorg/rcomp/tmp/1euhz1312550078.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/24h6t1312550078.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/3m1dc1312550078.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/4aaf41312550078.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/54nhb1312550078.tab") > > try(system("convert tmp/1euhz1312550078.ps tmp/1euhz1312550078.png",intern=TRUE)) character(0) > try(system("convert tmp/24h6t1312550078.ps tmp/24h6t1312550078.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.656 0.131 0.783