+ Reply to Thread
Results 1 to 4 of 4

Thread: Logistic regression and significance of continuous variables across 3 periods

  1. #1
    Points: 619, Level: 12
    Level completed: 38%, Points required for next Level: 31

    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Logistic regression and significance of continuous variables across 3 periods




    I'm currently working on a logistic regression analysis in R with a binary response variable (0 = non-used; 1 = used location). I am modeling 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 3 seasons (categorical variable with values 1-3). Would it be appropriate to build a model with the continuous independent variables and include a seasonal categorical variable into the same model? I'm not entirely sure how to evaluate whether the continuous independent variables differ across 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)

    summary(results_full)

  2. #2
    Omega Contributor
    Points: 38,374, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    6,998
    Thanks
    398
    Thanked 1,186 Times in 1,147 Posts

    Re: Logistic regression and significance of continuous variables across 3 periods

    not familiar with R coding, what does this part stand for "+(1|ID)+ (1|Year)+ (1|Site),".


    I basic first approach may be inserting an interaction term between the continuous and trichotomized variable.
    Stop cowardice, ban guns!

  3. #3
    Points: 619, Level: 12
    Level completed: 38%, Points required for next Level: 31

    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Logistic regression and significance of continuous variables across 3 periods

    Quote Originally Posted by hlsmith View Post
    not familiar with R coding, what does this part stand for "+(1|ID)+ (1|Year)+ (1|Site),".


    I basic first approach may be inserting an interaction term between the continuous and trichotomized variable.
    Thanks for the message! The (1|ID)...etc. stand for random effects in a generalized linear mixed effects model.

    The updated code that I developed after thinking about it this morning a little more is as follows:

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

    However, I'm not entirely sure if main effects need to be included into the model for logistic regression similar to ANOVA?

  4. #4
    Omega Contributor
    Points: 38,374, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    6,998
    Thanks
    398
    Thanked 1,186 Times in 1,147 Posts

    Re: Logistic regression and significance of continuous variables across 3 periods


    I thought that is what the "|" represented, but you didn't reference this was a multilevel logistic model. Both covariates at the same level in the model? If yes, I would assume that main effects should be in the model. But I could be wrong.


    Side note, should ID and Site be nested in year. I don't know your context, but ID seems like a small unit, then where, then when. But once again I could be wrong.
    Stop cowardice, ban guns!

+ Reply to Thread

           




Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats