6
$\begingroup$

I'm working on a project wherein I compare the presence/absence of a number of bird and herptile species between wetlands that have received three different treatments. The populations were surveyed across two different years. So the response variable is a binary categorical variable, and the predictor variables (wetland treatment and year of sampling) are also categorical.

The situation gets a bit more complicated in that different sampling schedules were used between the two years, resulting in different sample sizes between the two years. I'm looking at modeling animal presence/absence using the glm() function in R, but I'm not sure if there might be a more appropriate approach?

$\endgroup$

2 Answers 2

3
$\begingroup$

You can use the binomial GLM, as it provides the freedom to model different sample sizes, $m_i$. So, you can use glm() function as follows:

glm(cbind(presence, absence) ~ 1 + treatment + year, family=binomial)

where "presence" and "absence" show the number of present or absent cases.

$\endgroup$
0
1
$\begingroup$

I highly recommend you the R book, chapters 15 till 17. If you have just categorical variables and no continuous ones, Crawley' R Book suggests to make a contingency table or to convert your binary data in proportion data and analyze it then. I had the same problem (binary count data and just categorical explanatory variables) and made a binomial GLM and later a GLM with proportion data of counts. Both worked fine, outcome was the same.

$\endgroup$
1
  • 2
    $\begingroup$ This is fine, but just so you know, if you analyze your presence/absence data as a chi-squared, you will be using a score test, whereas the tests that come by default w/ a logistic regression are Wald tests. For more see here. $\endgroup$ Apr 17, 2015 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.