Ju Ko
Ju Ko

Reputation: 508

Multilevel Logistic Regression in R

For a trainee-ship, I'm evaluating a pro-environmental initiative where members can advertise the initiative to their neighbors to convince them to join as well.

I want to predict group membership (binary) from a set of predictors:

  1. Demographics (4 categorical, 2 continuous variables)
  2. Psychological Variables (9 continuous variables)
  3. Impressions of Neighborhood (8 continuous variables)
  4. Impressions of the initiative (2 categorical, 2 continuous)

The data were collected in 30 different neighborhoods so my supervisor suggested I control for neighborhood in my analysis.

What I want to do now is:

Add the four sets of predictors one after another to see if the model fit goes up--and, if so, due to which variables in the set--while controlling for neighborhood.

Is there any R package with documentation that will allow building such a model? Any literature tips on this kind of modeling, assumptions, interpretation of results, etc. are also more than welcome!

I have only worked with very basic multilevel models before, so I am kind of lost in this situation. Many thanks in advance!

Upvotes: 1

Views: 1030

Answers (1)

JohnSG
JohnSG

Reputation: 1667

You don't have any code in your question so may consider moving it to Cross Validated. As for learning how to model in R, Google will give many suggestions. But to give you a basic starting place

glm_out <- glm(group ~ D1 + ... + Neighborhood, family = binomial(), data = D)

where 'group' is your response, your predictors go where I've put D1 + ... and you include Neighborhood in the model as well. Nothing that you've described is nested so this should work to control for Neighborhood effects. Then you can use stepAIC from the MASS package to perform model selection.

glm_aic <- MASS::stepAIC(glm_out)
summary(glm_aic)

There are certainly other more complex procedures you could use.

Upvotes: 3

Related Questions