model for clustered longitudinal binary data
Adrien Combaz <Adrien.Combaz at ...> writes:
Dear list members,
[snip]
I measure a longitudinal binary outcome (correctness of detection, 0: incorrect, 1: correct) with respect to 5 different experimental conditions (1 baseline and 4 treatments). The outcome is always measured at the same 10 time points. Each of the 9 subjects participated in all 5 conditions. Additionally, for each subject and condition, the experiment was replicated 36 times. I therefore end up with 9*5*36=1620 binary longitudinal series (= trials of 10 points each).
My aim is to assess the influence of the experimental condition on my binary outcome. I need to build a model that would take into consideration the correlation along time for a given trial and the correlation among trials for a given subject.
Correlation among trials for a given subject should be straightforward, correlation along time for a given trial may be difficult (see below).
I am considering a 3 levels logistic models where 10 consecutive binary measurements (level 1) are obtained on replicates (level 2) which are clustered into subjects (level 3). My only level 1 covariate would be the time of measurement (ordinal factor, T = 1, ..., 10) and as level 2 covariate, I consider the experimental condition. I don't consider any level 3 covariate per se, but still want the model to account for between-subject variability.
This all seems reasonable. If you really want time to be treated as ordinal, you'll want to look at the clmm function from the 'ordinal' package. In most R modeling packages you don't need to state explicitly which levels the covariates are measured at (but keeping track of it is of course useful for thinking about issues of identifiability, etc.) A simple model would be something like response ~ time + expcond + (1|rep/sub) As a more complete model you could consider response ~ time + expcond + (time|rep/sub) + (expcond|sub)