Computes patient-level state occupancy probabilities from a supported Markov transition model. Frequentist first-order models use the optimized native engine; other supported workflows use the reference engine.
Usage
soprob_markov(
model,
newdata,
times = NULL,
y_levels,
absorb = NULL,
time_var = "time",
p_var = "yprev",
p2_var = NULL,
gap_var = NULL,
time_covariates = NULL,
include_re = FALSE,
id_var = NULL,
n_draws = 100L,
seed = NULL,
...
)Arguments
- model
A Markov transition model fitted by
vglm_markov(),orm_markov(), orblrm_markov(). The robustrobcov_vglmresult returned byvglm_markov()is supported; raw backend fits without fitting- wrapper provenance are not.- newdata
A data frame containing one baseline prediction row per patient or profile.
- times
Required consecutive visits, in increasing order. The recursion takes one transition per value, so leaving out visits does not skip time; see
sops(). Unlikesops(), this function does not warn whentimesleaves out fitted visits.- y_levels
Ordered outcome-state levels. The number of levels must equal the fitted threshold count plus one.
- absorb
Optional absorbing state levels.
- time_var
Name of the model time variable.
- p_var
Name of the previous-state variable.
- p2_var
Optional second previous-state variable. A non-
NULLvalue selects second-order recursion.- gap_var
Optional elapsed-time-gap variable.
- time_covariates
Optional data frame with one row per requested visit containing precomputed time-varying covariates.
- include_re
For
blrmfits, include fitted random-effect draws for known IDs.- id_var
ID column used for
blrmrandom effects.- n_draws
Number of
blrmposterior draws, orNULLfor all draws.- seed
Optional seed used when selecting posterior draws.
- ...
Reserved for internal posterior draw batching.
