I have some continuous positive data $Y_{ij}$ representing accumulated quantities, where $i$ denotes subject and $j$ a state. Patients are transitioning across states sequentially, but not all patients visit all states. Also, the assumption here is that $Y_{ij}$ were accumulated at a constant rate within each state $j$, but these rates are different across states. We have the times $t_{ij}$ where subjects spent in each state. We also have some other covariates, some time dependent, some not. The interest here is to estimate the mean rate conditional on state, as well as on values of the other covariates. This is different from estimating the mean $Y$ conditional on time, state and covariates.
I was thinking of fitting a generalized linear mixed model, with the following characteristics:
time values $t_{ij}$ can be used as offset, so that rate can be estimated
the model will be of the Gamma family with log link, for convenience for the offset (log of times will be used)
- the correlation between $Y_{ij}$ across $j$ values within $i$ will be expressed with one random effect expressing the random intercept per subject i
- states will be categorical variable (choosing one of them as baseline)
What I am not sure about is if I also need to use time as weights. I want to model the fact that $Y_{ij}$ for longer times should have higher “weight”, since the “rate” is estimated over a longer period of accumulation.
I was thinking of using glmer function in lme4 R package.
Any comment/suggestion would be greatly appreciated.