I have a dataset of longitudinal measurements for different sample individuals, with some covariates such as age, sex, time period, etc. The number of measurements taken for each individual varies. I would like to model the variance of the longitudinal measurements, including the covariates in the model with interactions between the covariates. My first instinct is that a hierarchical linear model could be appropriate, as there is a nested structure of correlated measurements within patients, and I am hoping that using a hierarchical linear model will also account for the differing number of observations within each individual (fewer measurements ~ less precise estimate ~ lower weight, something like that.) However, I have no idea where to begin when directly modeling the variance, instead of the mean, much less in the context of a hierarchical model.
Any advice or guidance would be greatly appreciated, either resources or code examples (R preferred). (I believe) that non-bayesian methods would be an easier sell, though I am generally open to methodology.
Thank you!
nlme::lme
, which allows you to specify a variance model. Or maybe, beta-regression is suitable, which allows modelling the precision parameter. Also, what exactly does "time period" measure? Do you perhaps need a survival model? $\endgroup$lme
function and pay special attention to the documentation of theweights
parameter as well as tohelp("varClasses")
. I still think you should model both mean and variance. $\endgroup$