Motivation-and-Behaviour / sleepIPD_analysis

Analysis for the sleep and physical activity pooled study (https://osf.io/gzj9w/)
Other
0 stars 0 forks source link

Protocol interpretation RQ1: Using study ID as a fixed effect. #51

Closed conig closed 1 year ago

conig commented 1 year ago

I am trying to implement the following for supplmentary materials. In the main manuscript we are using random intercepts for everything as we are hoping to generalise beyond the included studies. However it would be good to include models in supplementary materials that adhere as closely as possible to what we stateed in the protocol. The protocol states:

To examine the relationship between sleep and physical activity (Research Questions 1-2) we will use study fixed-effects to account for the nesting of participants in studies (Curran et al 2009). Fixed-effects (not the same as complete pooling analysis that ignores data nesting) control for all time-invariant between-study variance and will allow us to explore within study associations and moderators. We will nest individuals within days, and days within study. We will examine both main effects and subpopulation effects (using separate models), including the following pre-specified individual-level moderators; age (chronological), body mass index z-score (z transformed), SES, ethnicity, and sex as categorical.

It's very clear that study ID was intended to be a fixed effect. But the protocol is not explicit about what form the effects for measurement day and participant ID should take (beyond being nested within study).

Does this mean we include multiple fixed effects variables: " We will nest individuals within days, and days within study" e.g., the model becomes a lm?

lm(outcome ~ ... + study_id + measurement_day + participant_id )

Or should these be random intercepts

lme4::lmer(outcome ~ ... + study_id + (1|measurement_day / participant_id))

Either way I think we need some way to tag measurement_days as belonging to studies. I would assume we wouldn't want a single effect for measurement day 1 that cuts across multiple studies. I can't see why we'd want participants nested under measurement days however. That would ignore clustering by participants totally as we only have one observation per participant per measurement day.

What do you think @tarensanders?

conig commented 1 year ago

So far I'm doing a compromise. I pasted study to measurement day, so that that Day 1 in study 1 is treated differently to Day 1 in study 2.

lme4::lmer(outcome ~ ... + study_id + (1|measurement_day + participant_id))

This means we can use the same technique for research question 1 + 2. This cuts against:

Because age is time-invariant, we cannot explore Research Question 2 using fixed-effects models. Therefore, for this particular research question we will conduct a random-effects model in which the effect of between subject variables (e.g., age) can be modelled

conig commented 1 year ago

Measurement day needs to be dropped because day 1 doesn't have meaning whtin study. People starts on different days (and days of the week).