Advice for mixed model with multilevel effects in R 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!
/Adam
 A: 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.
