I have microbiota data from the same individuals in 2 timepoints. What is the correct formula to study the change / difference between timepoints?
There actually also are 3 experimental groups, but it might not be possible to use experimental groups AND individuals as factors in the same time, as we have limited n and the individuals of course belong to groups (?).
I would use ~ Indicator_of_time_point_2 + (1|subject_id)
with small_random_effects=TRUE
. The coefficient fit to Indicator_of_time_point_2
will give the average difference between time points, and (1|subject_id)
will control for repeated sampling. If you want to evaluate the effect of each experimental group, you could add + experimental_group
, but if the groups are just uninteresting subsets of individuals that don’t change per person (e.g., hospital or recruitment site), the subject_id
random intercept will be enough.
Will