Im migrating from SAS to R with a few difficulties, not to mention some large gaps in statistical knowledge.

Im investigating the effect of ethnicity on blood pressure, in a longitudinal study. For all ethnic groups, it is evident that their blood pressure declines the first 3-4 years and then it increases steadily thereafter (no other trend observed).

I have 100.000 observations, from 10.000 unique individuals. Data is heavily unbalanced; some individuals have 1 observation while others have 20. Observations are gathered at different time points.

Fixed covariates: age, sex, treatment, BMI, ethnicity. Random covariates: ethnicity Repeated measure unit: individual (ID).

How would You model this? I'm interested in the ethnic differences and must therefore have ethnicity as a fixed covariate. But ethnicity could be appreciated as a level in terms of multilevel models, and thus modeled as random in mixed models. Så my subjects are, if im not wrong, nested within ethnic groups.

I have read instruction manuals for both nlme package and lme4 package. I decided to go with lme4, despite non-linear trend in blood pressure but tried to adjust for this by taking the second polynomial of duration (time*time).

How would you model this? E.g:

lmer(hba1c_up ~ age + sex + (1|Ethnicityx/ID)) ?

lmer(hba1c_up ~ age + sex + (1|ID) + (1|Ethnicityx))

Any suggestions?

Help would be immensely appreciated!


  • 1
    $\begingroup$ Ethnicity is a fixed effect, not a random effect. $\endgroup$ – Patrick Coulombe Feb 11 '14 at 16:41
  • $\begingroup$ But can it not be modeled as "random" (lmer handles levels and randoms the same way) due to it being a level? Would anyone recommend the (1|Ethnicity/ID) version? Ie individuals nestes within ethnic groups? $\endgroup$ – user40049 Feb 11 '14 at 18:56

I agree with Patrick that ethnicity is a fixed effect, and is treated as such by every analysis I've seen. Remember, you can model any grouping variable as a random effect, but the question is whether that model accurately reflects reality.

You are likely specifically interested in whether and by how much, say, Latinos have a different BP trajectory than Pacific-Islanders, and so would model ethnicity as fixed to get a coefficient estimate and standard error. Something like classrooms in education research is modeled as a random effect because we know that classrooms affect the desired outcome (and they confer correlation between students), but we aren't interested in the influence of particular classrooms (don't need the coefficient estimate), and so control for them by parsimoniously modeling them as a sample of all possible classrooms with a mean 0 and unknown variance. Treating ethnicity as a random effect would control for ethnicity without letting you understand how one ethnicity might consistently effect the overall level or change in blood pressure.

  • $\begingroup$ (+1) Actually, treating ethnicity as a random effect would let you see how each ethnicity deviates from the overall level (by looking at the level-2 residuals, e.g. by using the ranef() command in R), but as you point out, you get no significance test. $\endgroup$ – Patrick Coulombe Feb 11 '14 at 22:26
  • $\begingroup$ Thank You all for Your replies. However, one question remains. Even though ethnicity is a fixed effect, which I accept, the development of blood pressure over time varies markedly by ethnicity. That is some ethnicities have a steeper increase in blood pressure over the same period of time. At the same time, some ethnicites started much higher in blood pressure (intercept). Which brings up the question of random slope; Should i be using random slope for ethnicity like: lmer(response ~ age + sex + (1+Ethnicityx|ID)) I might be terribly wrong here. $\endgroup$ – Adam Robinsson Feb 24 '14 at 9:14
  • $\begingroup$ Forgive me if main effect is the wrong terminology for regression, but the main effect variable will account for baseline/average differences in BP by ethnicity, while the interaction between ethnicity and time will provide estimates and test whether the changes in BP over time vary with ethnicity. Again, this gives you specific estimates and a hypothesis test for the BP trajectories by ethnicity, whereas using random slopes would only tell you that the trajectories do vary, but in a more general sense. $\endgroup$ – Moose Feb 24 '14 at 19:38

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.