I have a continuous dependent variable measured for several thousand subjects. The dependent variable has been measured one or more times per subject at nonuniform points in time. I am looking to generate nonlinear centile or reference charts. The structure of the data naturally direct me towards a mixed model approach.
GAMLSS::gamlss
and GAMLSS:centiles
appears to be used quite frequently to develop nonlinear centile or reference charts. The GAMLSS::gamlss
also interfaces with NLME::lme
to specify random effects in the GAMLSS model.
I have tried to produce a mixed effects model with the fixed effect of time and a random intercept and slope over time by subject with the following syntax, although it does not produce the anticipated linear centile plot and I am unsure how to add smoothing terms to this mixed model to produce nonlinear centile plots.
model <- gamlss(DV ~ re(fixed= ~ time, random= ~ 1 + time|subject),
...)
plot <- centiles(model, xvar=time)
Is GAMLSS the right approach for this problem? If yes, what is the correct syntax for the mixed model and how are smoothing terms applied to this function? If GAMLSS is not the right approach, is there another recommended approach?