Skip to main content
edited tags
Link
Robert Long
  • 65.8k
  • 11
  • 133
  • 248
grammar
Source Link
guest
  • 63
  • 3

I am running a multilevel log odds regression on a dataset that is at the individual level. Each individual belongs to a district, and there are both individual level variables (which vary by individual) and district level variables (which are constant per district). Let's call our explanatory variables ind_var1, ind_var2, dis_var1, dis_var2, our district dis, and our output variable out

I've been looking for the proper syntax on how to code this, and this is how far I've gotten:

mod1 = glmer(out ~ ind_var1 + ind_var2 + dis_var1 + dis_var2 + (1|dis), data = data, family = binomial(link = 'logit'))

My question is, is the above code correct syntax for construction the model, or does the syntax for the district level explanatory variables (dis_var1 and dis_var2) need to be edited?

I am running a multilevel log odds regression dataset that is at the individual level. Each individual belongs to a district, and there are both individual level variables (which vary by individual) and district level variables (which are constant per district). Let's call our explanatory variables ind_var1, ind_var2, dis_var1, dis_var2, our district dis, and our output variable out

I've been looking for the proper syntax on how to code this, and this is how far I've gotten:

mod1 = glmer(out ~ ind_var1 + ind_var2 + dis_var1 + dis_var2 + (1|dis), data = data, family = binomial(link = 'logit'))

My question is, is the above code correct syntax for construction the model, or does the syntax for the district level explanatory variables (dis_var1 and dis_var2) need to be edited?

I am running a multilevel log odds regression on a dataset that is at the individual level. Each individual belongs to a district, and there are both individual level variables (which vary by individual) and district level variables (which are constant per district). Let's call our explanatory variables ind_var1, ind_var2, dis_var1, dis_var2, our district dis, and our output variable out

I've been looking for the proper syntax on how to code this, and this is how far I've gotten:

mod1 = glmer(out ~ ind_var1 + ind_var2 + dis_var1 + dis_var2 + (1|dis), data = data, family = binomial(link = 'logit'))

My question is, is the above code correct syntax for construction the model, or does the syntax for the district level explanatory variables (dis_var1 and dis_var2) need to be edited?

Source Link
guest
  • 63
  • 3

Proper syntax for coding group level variables in mixed effect model using GLMER

I am running a multilevel log odds regression dataset that is at the individual level. Each individual belongs to a district, and there are both individual level variables (which vary by individual) and district level variables (which are constant per district). Let's call our explanatory variables ind_var1, ind_var2, dis_var1, dis_var2, our district dis, and our output variable out

I've been looking for the proper syntax on how to code this, and this is how far I've gotten:

mod1 = glmer(out ~ ind_var1 + ind_var2 + dis_var1 + dis_var2 + (1|dis), data = data, family = binomial(link = 'logit'))

My question is, is the above code correct syntax for construction the model, or does the syntax for the district level explanatory variables (dis_var1 and dis_var2) need to be edited?