Tuesday, 25 November 2014

(Generalised) linear (mixed) models with R2jags: an extremely brief primer...

The purpose of this lab (Friday 28th 2pm) is to provide a very basic primer on running basic lm, glm and glmms in a Bayesian framework using the R2jags package (and of course JAGS). As such, the goal is not to debate the relative merits of Bayesian vs frequentist approaches, but hopefully to demystify the fitting of Bayesian models, and more specifically demonstrate that in a wide variety of (more basic) use cases the parameter estimates obtained from the two approaches are typically very similar.

We will be attempting to reproduce a small element of the analysis from a recently published article in Journal of Ecology (for which all the data is available at datadryad.org).

Kessler, M., Salazar, L., Homeier, J., Kluge, J. (2014), Species richness-productivity relationships of tropical terrestrial ferns at regional and local scales. Journal of Ecology, 102: 1623-1633.

Code (jagstut.Rmd) and data (KessDiv.csv) available from dropbox or github. View the compiled html version here.

See you Friday,

1 comment:

  1. Download JAGS