3
$\begingroup$

I am doing a retrospective cohort study in which I have taken information from 4 health markers: calories, exercise time, work hours, and sleep hours as well as an outcome variable healthsurvey. All variables are continuous, take on only positive values, and are measured monthly across approximately 1000 subjects for two years - essentially, 24 measurements of each variable for each subject. The residuals are Gaussian, and the models below by and large fit the criteria for LMM diagnostics. The head of data looks like this:

There's significant autocorrelation within all dependent variables, and I was wondering how I could craft a model to judge associations between the four independent variables and the outcome. I was thinking a linear mixed model or a GLMM is the best way to go. I loaded nlme and lme4 into R and came up with these ideas, but I just want to know if I'm on the wrong track:

lme(healthsurvey~calories+exercise+laborhours+sleephours, random=calories+exercise+laborhours+sleephours|subject, correlation = corCompSymm(), method = "ML")

But if that didn't work, I was thinking of doing something with lme4, a package I'll admit I'm less familiar with:

lmer(healthsurvey~calories+exercise+laborhours+sleephours+(calories|subject)+(exercise|subject)+(laborhours|subject)+(sleephours|subject), REML=FALSE)

The specifics of variable selection/etc aren't important right now. I'd just like to know if a linear mixed model was a smart way to model this data, and if so, treating each of my covariates as random effects since they vary across subjects.

$\endgroup$
2
  • $\begingroup$ Are you interested in between-person effects, or within-person effects? $\endgroup$ Commented Oct 19, 2020 at 21:48
  • $\begingroup$ I'm interested in predicting the response variable for future time periods, which I assume would be a within-person effect? $\endgroup$ Commented Oct 22, 2020 at 16:14

1 Answer 1

4
$\begingroup$

Is a Mixed Model Appropriate for Repeated Measures of Multiple Covariates?

Yes, you have repeated measures within subjects, and you are not interested in specific subject effects, so a mixed model is appropriate for modelling these data.

There are a few things to note here.

  • The structure of the random effects in the two models are not equivalent. The lme model will estimate covariances between all the random effects, while the lmer model will not. To be equivalent, you would fit:
lmer(healthsurvey ~ calories + exercise + laborhours + sleephours + (calories + exercise + laborhours + sleephours | subject), REML = FALSE)
  • The random structure is quite complex; it will estimate 15 variances and covariances and it would not be surprising to find a singular fit. Your 2nd model is actually one approach to simplifying the random structure in such a case.

  • You mention autocorrelation, so you might want to explore an AR(1) correlation structure in the lme model.

  • You may be interested in contextual effects - that is, in between-subject and within-subject effects for the fixed effects. In order to do this, for each fixed efect variable, you would create a new variable consiting of the means for each subject, and then another variable being the difference between the original variable and the group mean. Then you include these two new variables in the model, but not the original one.

  • Your models do not include time which implies that you are not interested in any temporal effects.

$\endgroup$
2
  • $\begingroup$ Thanks a lot! I've looked at autocorrelation and I think compound symmetry is a better way to look at this data. I am, however, interested in temporal effects, since I want to use this model to forecast the outcome variable in later time periods, i.e., at time = 31-35. Would it be best to have each of my variables interact with time here? $\endgroup$ Commented Oct 22, 2020 at 16:13
  • $\begingroup$ If you have reason to think that the association of a variable with the outcome depends on time, then yes, an interaction of that variable with time would be a good idea. Bear in mind that if you are fitting random slopes for that variable then you would also want to consider random slopes for the interaction and also for time, but with so many terms in the random structure I would be surprised if it would converge sensibly. $\endgroup$ Commented Oct 22, 2020 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.