I’m analysing an adult cohort where each participant contributes a different number of BMI readings taken at different ages (some are better characterized, other worse). The goal is to quantify in the different groups how much time it takes for a group (stratified according to a specific condition) to reach "obesity" (IMC =>30), in this context, I thought joint models may be useful due to my repeated measures over time. My thought after considering serveral approachas was to build a joint model in JMbayes2 that links repeated BMI measurements to the time at which someone becomes obese (30 kg/m2).
My study:
- ~14 000 adults, BMI measured up to ten times (1990-2024)
- Baseline covariates: age, sex, smoking, education, diabetes, hypertension
- I want the event to be “BMI ≥ 30”, but people can cross that line more than once.
1. Handling a reversible obesity threshold (BMI ≥ 30 kg m²)
My first instinct is to use the first time BMI hits 30 as the event (I create a variable called event(0,1)) and ignore later reversions, but I’m not sure that’s fully correct. Is there a standard way to treat a threshold that can be crossed, reversed, and crossed again?
- Some participants cross 30 once and stay obese.
- Others bounce above and below 30 over time.
2. Non-linear time in the longitudinal sub-model
The BMI curve is clearly non-linear (inverted-U). Can I just plug a spline term in the joint model? —e.g.with sex and group interactions.

The following code is one of the tested models accounting for interactions and non-linear components of time
#mixed-effects model
mod_gam2 <- lme(variable~bs(seg,df=4)*group*sexo+fumador+diabetes+hipercol+hta + educ + cohort ,random = ~1 | id2, correlation = corCAR1(form = ~seg | id2), control = lmeControl(opt="optim"), data=xxx, method='REML', na.action=na.exclude)
#survival model
coxfit <- coxph(coxph(Surv(years, event) ~ group*sexo+fumador+diabetes+hipercol+hta + educ + cohort, data = xxx))
Does the joint model support this? Is able to capture non-linear interactions?
#Joint model
jmodel <- jm(mod_gam2, coxfit, timeVar = "seg")
3 Do both sub-models need identical covariates?
Regarding the prior syntax. Is there a principled rule about adjusting for the same covariates in the mixed-model and the survival one?
Any thoughts, pointers would be really appreciated. Thanks!