R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(41 + ,48 + ,52 + ,53 + ,65 + ,68 + ,64 + ,57 + ,55 + ,54 + ,59 + ,66 + ,83 + ,100 + ,101 + ,98 + ,92 + ,85 + ,92 + ,94 + ,90 + ,99 + ,108 + ,106 + ,99 + ,100 + ,99 + ,93 + ,92 + ,93 + ,98 + ,95 + ,86 + ,85 + ,83 + ,85 + ,80 + ,84 + ,86 + ,87 + ,85 + ,83 + ,76 + ,70 + ,78 + ,83 + ,88 + ,90 + ,90 + ,97 + ,102 + ,101 + ,98 + ,98 + ,100 + ,102 + ,108 + ,112 + ,110 + ,110 + ,117 + ,120 + ,119 + ,113 + ,123 + ,120 + ,129 + ,132 + ,136 + ,141 + ,122 + ,137 + ,145 + ,155 + ,148 + ,153 + ,172 + ,169 + ,180 + ,190 + ,233 + ,231 + ,245 + ,299 + ,385 + ,381 + ,322 + ,317 + ,323 + ,393 + ,372 + ,387 + ,413 + ,405 + ,407 + ,392 + ,363 + ,358 + ,375 + ,370 + ,386 + ,353 + ,347 + ,363 + ,350 + ,347 + ,333 + ,327 + ,328 + ,309 + ,286 + ,319 + ,285 + ,301 + ,315 + ,388 + ,383 + ,417 + ,423 + ,430 + ,486 + ,394 + ,411 + ,431 + ,447 + ,432 + ,457 + ,453 + ,441 + ,416 + ,451 + ,432 + ,436 + ,429 + ,421 + ,425 + ,437 + ,432 + ,413 + ,419 + ,436 + ,421 + ,424 + ,402 + ,403 + ,400 + ,426 + ,418 + ,403 + ,405 + ,394 + ,400 + ,376 + ,367 + ,354 + ,348 + ,364 + ,329 + ,348 + ,330 + ,351 + ,336 + ,332 + ,349 + ,384 + ,370 + ,346 + ,338 + ,335 + ,338 + ,347 + ,372 + ,376 + ,373 + ,392 + ,374 + ,385 + ,372 + ,372 + ,352 + ,353 + ,330 + ,348 + ,346 + ,361 + ,364 + ,375 + ,369 + ,342 + ,338 + ,337 + ,333 + ,336 + ,322 + ,329 + ,322 + ,325 + ,331 + ,311 + ,318 + ,312 + ,315 + ,333 + ,311 + ,321 + ,316 + ,284 + ,281 + ,280 + ,266 + ,268 + ,278 + ,292 + ,263 + ,265 + ,266 + ,251 + ,256 + ,280 + ,283 + ,289 + ,308 + ,293 + ,281 + ,274 + ,277 + ,278 + ,250 + ,265 + ,269 + ,262 + ,258 + ,251 + ,243 + ,247 + ,224 + ,241 + ,255 + ,261 + ,267 + ,264 + ,270 + ,275 + ,281 + ,301 + ,321 + ,355 + ,319 + ,299 + ,319 + ,328 + ,348 + ,335 + ,333 + ,331 + ,318 + ,325 + ,318 + ,313 + ,313 + ,315 + ,298 + ,311 + ,309 + ,297 + ,294 + ,291 + ,292 + ,290 + ,287 + ,281 + ,295 + ,289 + ,286 + ,295 + ,291 + ,315 + ,306 + ,304 + ,309 + ,307 + ,299 + ,294 + ,295 + ,296 + ,294 + ,292 + ,290 + ,289 + ,310 + ,297 + ,301 + ,302 + ,297 + ,305 + ,298 + ,299 + ,273 + ,267 + ,266 + ,284 + ,276 + ,284 + ,285 + ,267 + ,273 + ,262 + ,246 + ,251 + ,248 + ,255 + ,245 + ,251 + ,261 + ,259 + ,271 + ,258 + ,253 + ,239 + ,241 + ,281 + ,285 + ,289 + ,290 + ,290 + ,305 + ,289 + ,302 + ,294 + ,301 + ,299 + ,312 + ,310 + ,312 + ,309 + ,292 + ,284 + ,290 + ,292 + ,297 + ,316 + ,320 + ,304 + ,301 + ,322 + ,309 + ,308 + ,311 + ,328 + ,343 + ,345 + ,342 + ,350 + ,322 + ,311 + ,319 + ,328 + ,320 + ,321 + ,331 + ,342 + ,322 + ,307 + ,302 + ,307 + ,301 + ,315 + ,342 + ,333 + ,332 + ,332 + ,330 + ,322 + ,319 + ,345 + ,324 + ,322 + ,325 + ,325 + ,335 + ,335 + ,335 + ,341 + ,320 + ,324 + ,328 + ,329 + ,338 + ,336 + ,361 + ,353 + ,352 + ,393 + ,393 + ,420 + ,435 + ,468 + ,466 + ,481 + ,511 + ,508 + ,480 + ,496 + ,487 + ,473 + ,473 + ,488 + ,479 + ,501 + ,503 + ,497 + ,496 + ,490 + ,482 + ,486 + ,493 + ,522 + ,546 + ,534 + ,570 + ,624 + ,640 + ,589 + ,559 + ,570 + ,590 + ,588 + ,566 + ,630 + ,576 + ,642 + ,626 + ,718 + ,750 + ,690 + ,667 + ,689 + ,666 + ,662 + ,666 + ,681 + ,705 + ,783 + ,758 + ,776 + ,812 + ,824 + ,887 + ,984 + ,1016 + ,897 + ,980 + ,957 + ,969 + ,1063 + ,1048 + ,968 + ,1022 + ,1014 + ,1035 + ,1069 + ,1038 + ,1133 + ,1260 + ,1207 + ,1235 + ,1297 + ,1179 + ,1332 + ,1323 + ,1248 + ,1248 + ,1260 + ,1260 + ,1317 + ,1308 + ,1380 + ,1327 + ,1327) > par1 = '12' > par1 <- as.numeric(par1) > (n <- length(x)) [1] 479 > (np <- floor(n / par1)) [1] 39 > 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] [1,] 41 83 99 80 90 117 145 385 363 328 486 436 403 [2,] 48 100 100 84 97 120 155 381 358 309 394 429 400 [3,] 52 101 99 86 102 119 148 322 375 286 411 421 426 [4,] 53 98 93 87 101 113 153 317 370 319 431 425 418 [5,] 65 92 92 85 98 123 172 323 386 285 447 437 403 [6,] 68 85 93 83 98 120 169 393 353 301 432 432 405 [7,] 64 92 98 76 100 129 180 372 347 315 457 413 394 [8,] 57 94 95 70 102 132 190 387 363 388 453 419 400 [9,] 55 90 86 78 108 136 233 413 350 383 441 436 376 [10,] 54 99 85 83 112 141 231 405 347 417 416 421 367 [11,] 59 108 83 88 110 122 245 407 333 423 451 424 354 [12,] 66 106 85 90 110 137 299 392 327 430 432 402 348 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 364 335 353 336 321 251 265 264 335 297 315 289 [2,] 329 338 330 322 316 256 269 270 333 294 306 310 [3,] 348 347 348 329 284 280 262 275 331 291 304 297 [4,] 330 372 346 322 281 283 258 281 318 292 309 301 [5,] 351 376 361 325 280 289 251 301 325 290 307 302 [6,] 336 373 364 331 266 308 243 321 318 287 299 297 [7,] 332 392 375 311 268 293 247 355 313 281 294 305 [8,] 349 374 369 318 278 281 224 319 313 295 295 298 [9,] 384 385 342 312 292 274 241 299 315 289 296 299 [10,] 370 372 338 315 263 277 255 319 298 286 294 273 [11,] 346 372 337 333 265 278 261 328 311 295 292 267 [12,] 338 352 333 311 266 250 267 348 309 291 290 266 [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36] [,37] [1,] 284 251 290 284 328 342 322 324 468 501 624 718 [2,] 276 261 305 290 343 322 319 328 466 503 640 750 [3,] 284 259 289 292 345 307 345 329 481 497 589 690 [4,] 285 271 302 297 342 302 324 338 511 496 559 667 [5,] 267 258 294 316 350 307 322 336 508 490 570 689 [6,] 273 253 301 320 322 301 325 361 480 482 590 666 [7,] 262 239 299 304 311 315 325 353 496 486 588 662 [8,] 246 241 312 301 319 342 335 352 487 493 566 666 [9,] 251 281 310 322 328 333 335 393 473 522 630 681 [10,] 248 285 312 309 320 332 335 393 473 546 576 705 [11,] 255 289 309 308 321 332 341 420 488 534 642 783 [12,] 245 290 292 311 331 330 320 435 479 570 626 758 [,38] [,39] [1,] 776 968 [2,] 812 1022 [3,] 824 1014 [4,] 887 1035 [5,] 984 1069 [6,] 1016 1038 [7,] 897 1133 [8,] 980 1260 [9,] 957 1207 [10,] 969 1235 [11,] 1063 1297 [12,] 1048 1179 > 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] 56.83333 95.66667 92.33333 82.50000 102.33333 125.75000 [7] 193.33333 374.75000 356.00000 348.66667 437.58333 424.58333 [13] 391.16667 348.08333 365.66667 349.66667 322.08333 281.66667 [19] 276.66667 253.58333 306.66667 318.25000 290.66667 300.08333 [25] 292.00000 264.66667 264.83333 301.25000 304.50000 330.00000 [31] 322.08333 329.00000 363.50000 484.16667 510.00000 600.00000 [37] 702.91667 934.41667 1121.41667 > arr.sd [1] 8.032132 7.738139 6.198729 5.664884 6.527332 8.975978 [7] 48.195310 34.570416 16.884635 55.434373 24.152765 10.405054 [13] 24.546184 17.148858 18.237491 14.760718 8.857029 19.443781 [19] 17.259165 13.111122 30.040377 10.955488 4.499158 7.890827 [25] 15.015144 15.564139 18.054631 8.540013 12.094326 12.336200 [31] 15.150508 8.759411 37.792496 14.602822 27.236339 30.442196 [37] 40.928893 94.510662 111.127657 > arr.range [1] 27 25 17 20 22 28 154 96 59 145 92 35 78 55 57 45 25 58 58 [20] 45 91 37 16 25 44 40 51 23 38 39 41 26 111 45 88 83 121 287 [39] 329 > (lm1 <- lm(arr.sd~arr.mean)) Call: lm(formula = arr.sd ~ arr.mean) Coefficients: (Intercept) arr.mean -7.87352 0.08728 > (lnlm1 <- lm(log(arr.sd)~log(arr.mean))) Call: lm(formula = log(arr.sd) ~ log(arr.mean)) Coefficients: (Intercept) log(arr.mean) -1.8866 0.8253 > (lm2 <- lm(arr.range~arr.mean)) Call: lm(formula = arr.range ~ arr.mean) Coefficients: (Intercept) arr.mean -21.7529 0.2588 > postscript(file="/var/wessaorg/rcomp/tmp/16rsm1356026336.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/2t2a51356026336.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/3m6lp1356026336.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/43czx1356026336.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/5f0e31356026336.tab") > > try(system("convert tmp/16rsm1356026336.ps tmp/16rsm1356026336.png",intern=TRUE)) character(0) > try(system("convert tmp/2t2a51356026336.ps tmp/2t2a51356026336.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.570 0.324 1.870