Skip to content
Prev 19948 / 20628 Next

time*treatment vs time + time:treatment in RCTs

BTW, this is actually a rather annoying feature of the ways model 
formulas work in R. For a *randomised* longitudinal study, the 
population means for the randomisation groups are *identical* at 
baseline (due to the randomisation). So to properly *adjust* for any 
(random) group unbalances at baseline in the samples, one should fit a 
model *without* a ?group? effect at baseline. (I know it sounds strange 
to fit a model without group differences at baseline to *adjust* for any 
baseline differences, but if you think about it for a while, it makes 
sense ?)

So instead of fitting

time + group + time:group + ...

(where ?group? represents the population differences at baseline)

one would naively *think* that one should fit a

time + time:group + ...

model. But R changes the *meaning* of the ?time:group? term in the 
second model, so one ends up fitting the exact same model as the first 
model (though with a different parametrisation), i.e., a model *not* 
adjusting for any sample differences at baseline.

The only way I?ve found to easily fit the proper model, is to create a 
factor of all ?interaction(time, group)? values and manually collapse 
the baseline groups to have the same level. That works fine, but it 
makes some tests *much* more complication, as you can no longer use R?s 
formula handling for simplifying models.


Karl Ove Hufthammer

Karl Ove Hufthammer skreiv 29.08.2022 20:59: