-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Hi Prof. Jackson,
I hope all is well.
I am using msm to fit a four-state disease model (states 1,2,3 are transient, state 4 absorbing). The covariate sex is essential to compare male vs. female transition patterns in a specific region.
The model runs fine on the full dataset, but after subsetting to the region of interest (sample size decreases), I encounter:
pmatrix.msmfails with:Error in balance(baP$z, "s") : R_dgebal(*, type="S"): Infinite matrix entry.sojourn.msmreturns identical estimates forcovariates = list(sex="male")andsex="female", indicating the covariate effect is not captured.
sojourn.msm(data.msm_region, covariates=list(sex="male"))
Warning message:
In msm.parse.covariates(x, covariates, x$qmodel) :
Ignoring covariates - no covariates in this part of the model
Diagnostic evidence:
- Fitted Q-matrix for the regional data (extremely wide CIs for some transitions):
State 1 -> State 3: 9.745e-07 (6.921e-17, 1.372e+164)
State 3 -> State 1: 1.164e-09 (0.000e+00, Inf)
These suggest highly unstable parameter estimates. - Sex-specific transition frequencies (regional subset):
Males: 1→3 (162), 3→1 (125)
Females: 1→3 (369), 3→1 (216)
Although non-zero, the per-sex sample size for these transitions may be insufficient to stably estimate covariate effects.
Attempted fix:
I switched to L-BFGS-B with maxit = 100000,but the problem persists.
control = list(method = "L-BFGS-B", control = list(maxit = 100000, trace = 1))
My questions:
- What are the likely reasons for this behavior? Is it due to sparse data per sex for certain transitions, leading to flat likelihoods or boundary estimates for covariate parameters?
- What should be the next steps?
Thank you for your help!