I'm currently working on a logistic regression analysis in R where my response variable is 1 = used animal location and 0 = random location. I am modelling non-random habitat selection for a species of wildlife. I recently ran into an issue where I need to evaluate non-random habitat selection across 3 seasonal periods to determine if habitat selection varies by season. In other words, I need to determine if my continuous independent variables differ across season. Would it be appropriate to build a model with the continuous independent variables and include a seasonal categorical variable into the model? See example code below where R0A1 is defined as the used and random locations (1 and 0, respectively), MP_Scaled, MPHW_Scaled, HW_Scaled, YP_Scaled, AG_Scaled, and Shrub_Scaled are continuous variables, and Season is a categorical variable (1 = winter, 2 = preincubation, and 3 = summer). I recognize that logistic regression will treat one of the seasonal values as a reference category which is fine but need to determine if the continuous variables differ across season and if so, need to output the beta coefficients for each season.

results_full <- glmer(R0A1 ~ MP_Scaled+ MPHW_Scaled+ HW_Scaled +
                             YP_Scaled+ AG_Scaled+ Shrub_Scaled+
                             Season+ (1|ID)+ (1|Year)+ (1|Site),
                             data=secondorder, family=binomial)


1 Answer 1


Using a dummy indicator variable might be more simple. This avoids constraining the seasonal effect due to a 1, 2 and three scoring.

If you have 3 seasons, then use 2 variables; say winter and preincubation. For a summer observation both these variables are 0. For a winter observation, winter = 1 and preincubation = 0. For a preincubation observation winter = 0 and preincubation = 1.

  • $\begingroup$ You're welcome. If you think the answer is usable, you can check the check mark on the left of the answer to indicate the validity of the answer! $\endgroup$
    – spdrnl
    Commented May 12, 2015 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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