Please use D2L to turn in both the HTML output and your R Markdown file in.

We will revisit the Swiss birds dataset for this lab to construct a Poisson regression model for abundance of the Willow Tit.

library(knitr)
swiss.birds <- read.csv('http://math.montana.edu/ahoegh/teaching/stat491/data/willowtit2013_count.csv')
kable(head(swiss.birds))
siteID elev rlength forest bird.count searchDuration
Q001 450 6.4 3 0 160
Q002 450 5.5 21 0 190
Q003 1050 4.3 32 3 150
Q004 950 4.5 9 0 180
Q005 1150 5.4 35 0 200
Q006 550 3.6 2 0 115

This dataset contains 242 sites and 6 variables. The only difference from the lab is:
- bird.count, count variable for abndance of birds observed, rather than a binary outcome

1. (5 points) Model Specification

Clearly write out the model, using proper notation for the variables in bird dataset. You don’t need use all variables, but you should state which are included.

2. (5 points) Priors

Describe and justify the necessary priors for this model.

3. (5 points) Fit MCMC

Fit the JAGS code for this model. You will have to put this together following the specification in the previous examples, but the following statement can be used for the sampling model portion.

model {
  for (i in 1:Ntotal) {
    y[i] ~ dpois(mu[i])
    mu[i] <- exp(beta0 + sum( beta[1:Nx] * x[i,1:Nx] ))
  }
  # priors inserted here
  
}

4. (5 points) Summarize inferences from model

Talk about the model and discuss which and how predictor variables influence the observation of a bird. Furthermore, discuss the differences between this model and the logistic regression setting.