I'm struggling to set random effects for my linear mixed effect model. I've been trying to go about it using a top down approach in accordance to Zuur et al. (2009), but due to the fact that you have to specify a model with a complexity beyond what you expect or want, defining the combinations of random effects for the model is proving to be challenging.
The problem I have stems from the fact that most literature/guides/tutorials I've seen give basic examples on how to set random effects and rarely venture past defining basic slopes and nesting.
My study is one where all participants were exposed to the same treatments on different days (5 treatments in total), the order was randomized. So my grouping variable is participant. During each treatment 8 five minute blood pressure measurements were taken. So my dependent variable is blood pressure and my fixed effects are treatment and which 5 minute window the measurement belongs to (an ordinal categorical variable with 8 levels). Other random effects I chose to include to try to explain as much variance as possible are
- Visit number - which visit in sequence it was for each treatment.
- Age of participant
- BMI of participant
- Respiratory frequency during 5 min measurement
- How physically active the participant is
- How the participant experienced the whole ordeal
- How much sleep the the participant getting
So i defined the fixed effects as such:
model <- lmer(blood_pressure ~ treatment * 5_min_window + sex, data=data_all)
I added in sex since it can't be a random effect with only 2 levels.
The problem starts when adding random effects. My first question is should I define random slopes corresponding to all of my fixed effects? So for example:
(blood_pressure|person) + (treatment|person) + (sex|person) + (blood_pressure|visit_number) + (treatment|visit_number) etc.
Should the within subject grouping be such that i add all fixed effects? Something in line with
(treatment * 5_min_window|person).
Also of note is the presence of 8 five minute measurements during each treatment. Should nesting be somehow incorporated?
Once the beyond optimal model is defined the algorithm to prune it down is straight forward. But getting to that beyond optimal model is challenging. It feels like it's something you get much better at with experience or maybe not. Either way any help will be highly appreciated.