R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: i686-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(426.113 + ,383.703 + ,232.444 + ,70.939 + ,226.731 + ,947.293 + ,611.281 + ,158.047 + ,33.999 + ,37.028 + ,388.3 + ,506.652 + ,392.25 + ,180.818 + ,198.296 + ,217.465 + ,275.562 + ,1030.944 + ,57.47 + ,136.452 + ,556.277 + ,213.361 + ,274.482 + ,220.553 + ,236.71 + ,260.642 + ,2763.544 + ,213.923 + ,169.861 + ,403.064 + ,449.594 + ,406.167 + ,206.893 + ,156.187 + ,257.102 + ,62.156 + ,662.883 + ,251.422 + ,171.328 + ,350.089 + ,221.588 + ,4.813 + ,183.186 + ,190.379 + ,223.166 + ,232.669 + ,356.725 + ,109.215 + ,475.834 + ,315.955 + ,694.87 + ,8.95 + ,278.741 + ,308.16 + ,207.533 + ,192.797 + ,601.162 + ,289.714 + ,293.671 + ,386.688 + ,699.645 + ,85.094 + ,131.812 + ,645.285 + ,197.549 + ,308.174 + ,86.58 + ,242.205 + ,238.502 + ,187.881 + ,140.321 + ,440.31 + ,421.403 + ,218.761 + ,1305.923 + ,137.55 + ,262.517 + ,348.821 + ,150.034 + ,64.016 + ,261.596 + ,259.7 + ,171.26 + ,203.077 + ,249.148 + ,211.655 + ,252.64 + ,438.555 + ,239.89 + ,401.915 + ,216.886 + ,184.641 + ,380.155 + ,653.641 + ,313.906 + ,366.936 + ,236.302 + ,229.641 + ,235.577 + ,103.898 + ,263.906 + ,241.171 + ,216.548 + ,295.281 + ,193.299 + ,204.386 + ,257.567 + ,136.813 + ,240.755 + ,59.609 + ,213.511 + ,380.531 + ,242.344 + ,250.407 + ,183.613 + ,191.835 + ,266.793 + ,246.542 + ,330.563 + ,403.556 + ,208.108 + ,324.04 + ,308.532 + ,199.297 + ,200.156 + ,262.875 + ,287.069 + ,190.157 + ,199.746 + ,265.777 + ,435.956 + ,72.844 + ,756.46 + ,206.771 + ,4202.361 + ,401.422 + ,216.046 + ,39.047 + ,441.437) > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = '' > par3 = '' > par2 = '' > par1 = '4' > par1 <- as.numeric(par1) > (n <- length(x)) [1] 139 > (np <- floor(n / par1)) [1] 34 > 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] [1,] 426.113 226.731 33.999 392.250 275.562 556.277 236.710 169.861 206.893 [2,] 383.703 947.293 37.028 180.818 1030.944 213.361 260.642 403.064 156.187 [3,] 232.444 611.281 388.300 198.296 57.470 274.482 2763.544 449.594 257.102 [4,] 70.939 158.047 506.652 217.465 136.452 220.553 213.923 406.167 62.156 [,10] [,11] [,12] [,13] [,14] [,15] [,16] [,17] [,18] [1,] 662.883 221.588 223.166 475.834 278.741 601.162 699.645 197.549 238.502 [2,] 251.422 4.813 232.669 315.955 308.160 289.714 85.094 308.174 187.881 [3,] 171.328 183.186 356.725 694.870 207.533 293.671 131.812 86.580 140.321 [4,] 350.089 190.379 109.215 8.950 192.797 386.688 645.285 242.205 440.310 [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26] [,27] [1,] 421.403 262.517 261.596 249.148 239.890 380.155 236.302 263.906 193.299 [2,] 218.761 348.821 259.700 211.655 401.915 653.641 229.641 241.171 204.386 [3,] 1305.923 150.034 171.260 252.640 216.886 313.906 235.577 216.548 257.567 [4,] 137.550 64.016 203.077 438.555 184.641 366.936 103.898 295.281 136.813 [,28] [,29] [,30] [,31] [,32] [,33] [,34] [1,] 240.755 242.344 266.793 208.108 200.156 199.746 756.460 [2,] 59.609 250.407 246.542 324.040 262.875 265.777 206.771 [3,] 213.511 183.613 330.563 308.532 287.069 435.956 4202.361 [4,] 380.531 191.835 403.556 199.297 190.157 72.844 401.422 > 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] 278.2998 485.8380 241.4948 247.2072 375.1070 316.1683 868.7047 [8] 357.1715 170.5845 358.9305 149.9915 230.4438 373.9022 246.8077 [15] 392.8088 390.4590 208.6270 251.7535 520.9093 206.3470 223.9083 [22] 287.9995 260.8330 428.6595 201.3545 254.2265 198.0163 223.6015 [29] 217.0498 311.8635 259.9943 235.0643 243.5807 1391.7535 > arr.sd [1] 161.30699 366.63335 242.70784 97.84655 446.42314 162.37976 [7] 1263.37017 126.66731 83.20179 215.42057 98.21046 101.16205 [13] 288.65112 55.50825 145.95132 326.94461 93.19385 131.94197 [19] 536.78238 125.01090 44.37415 102.07052 96.74589 152.69525 [25] 65.03948 33.51259 49.51416 131.55033 34.18725 70.84122 [31] 65.40670 47.30461 151.18800 1887.50738 > arr.range [1] 355.174 789.246 472.653 211.432 973.474 342.916 2549.621 279.733 [9] 194.946 491.555 216.775 247.510 685.920 115.363 311.448 614.551 [17] 221.594 299.989 1168.373 284.805 90.336 226.900 217.274 339.735 [25] 132.404 78.733 120.754 320.922 66.794 157.014 124.743 96.912 [33] 363.112 3995.590 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -285.716 1.553 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -5.024 1.746 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -583.039 3.241 > postscript(file="/var/wessaorg/rcomp/tmp/14mrl1381216306.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/2tfdd1381216306.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/3qmnt1381216306.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/4f7pn1381216306.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/5em9c1381216307.tab") > > try(system("convert tmp/14mrl1381216306.ps tmp/14mrl1381216306.png",intern=TRUE)) character(0) > try(system("convert tmp/2tfdd1381216306.ps tmp/2tfdd1381216306.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.421 0.337 1.739