I have longitudinal study to analyse. M patients examined at N time points.
I want to run a marginal model via GLS estimation with unstructured residual covariance. But I want also to apply the Kenward-Roger degrees of freedom.
In R, in which I work, this is impossible for the GLS. I have to switch to a mixed model, using the lme4. This one only allows for random effects to be specified.
But I know I can approximate gls by lme4 with some effort. For example, often people simulate the compound symmetry with random intercepts: every patient can have the same correlation over time, but can start from a different value (intercept).
Unstructured covariance means, that every 2 patients at every 2 time points can be different.
Which formula corresponds the best to it?
a) random intercept + slope (for time):
Response ~ Treatment * Time + (1 + Time | PatientID)
b) random slope (for time) only, so all slopes (i.e. different correlations, as I wanted), but the intercepts will be same for all patients:
Response ~ Treatment * Time + (0 + Time | PatientID)
I know, I will need to fix some warnings in the lme4, but that's not a problem. Only the above is my concern.
EDIT: Kindly please, help me in this very problem, don't propose "other solutions" or do not tell me "you do not have to do this", as it does not help me at all.
gls
function. If you can't find the trick there there is probably a different implementation of GLS that will do it. Random slopes and intercepts introduce computational problems and complexity. But if you want to mimic an unstructure correlation pattern you may need a random shapes model. $\endgroup$