Category Archives: Uncategorized

Simulation of More Complex Models

Hi class,

The book by Marc Kery “Introduction to WinBUGS for Ecologists” makes extensive use of simulated datasets. It starts with a mean model, and then t-tests, and goes up through GLMMs including ZIPs and mixture models.   See the book web site for a couple of sample chapters.

The code from his book is in this file R_WB_Code.txt .  There are no data files because he simulates everything (I think he does use real data in some of the exercises).  I also downloaded an errata file and an updated appendix with tips for using WinBUGS.  WinBUGS and OpenBUGS are very similar, so most of the advice should apply to either program.

I’ll go over one of the examples for simulating a GLMM.  We’ll even throw in some autocorrelation, if I can figure out how to do it.

Jack

Logistic Regression on Tree Failure – Weird Results

Hi class,

I’ve been working on Brian Kane’s tree failure data from last October’s snowstorm, and got some weird results.  I set up a logistic regression with Failure as a response (tree broke = 1, not=0), and something funny is happening.  When I run a full model with a random slope and intercept, it doesn’t run on my portable, but it does run on my desktop!  Attached are the data file for Acer rubrum: 190 trees in several locations around campus.  The locations are the random effect.  DBH, presence of a defect and leaves on or off are the three fixed effects.  Here is my data file (dfAcRu.csv) and my R script (AcerRubrum.r).  If you have a chance, could you try running the script on your computer and see if it works?

Thanks.

Jack