blrm_markov() fits a model using rmsb::blrm() and stores the data needed
by subsequent SOP and inference functions. It uses x = TRUE and
y = TRUE by default,
rejects offsets, and stores separate likelihood, refit, and designated-start
profile data plus the optional patient ID on the returned model. Bayesian
fits do not receive
cluster-robust covariance; posterior uncertainty comes from the fitted
blrm draws.
Usage
blrm_markov(
formula,
ppo = NULL,
cppo = NULL,
data,
...,
id_var = NULL,
time_var = "time",
first_followup_time = NULL,
x = TRUE,
y = TRUE
)Arguments
- formula
a R formula object that can use
rmspackage enhancements such as the restricted interaction operator- ppo
formula specifying the model predictors for which proportional odds is not assumed
- cppo
a function that if present causes a constrained partial PO model to be fit. The function specifies the values in the Gamma vector in Peterson and Harrell (1990) equation (6). Sometimes to make posterior sampling better behaved, the function should be scaled and centered. This is done by wrapping
cppoin a function that scales thecpporesult before returning the vector value, whennormcppoisTRUE. The default normalization is based on the mean and standard deviation of the function values over the distribution of observed Y. For getting predicted values and estimates post-blrm(),cppomust not reference any functions that are not available at such later times.- data
a data frame; defaults to using objects from the calling environment
- ...
passed to
rstan::optimizing()or thercmdstanoptimizing function.sampling.argsis usually used instead.- id_var
Optional character scalar naming the patient or cluster ID column in
data. When supplied, SOP calls can reuse the stored full data and infer the ID column for baseline extraction and random-effect prediction.- time_var
Character scalar naming the modeled time column used to identify the designated starting-profile row.
- first_followup_time
First scheduled post-baseline outcome time used to select the starting-profile row. See
orm_markov()for the numeric and categorical time contracts.- x
set to
FALSEto not store the design matrix in the fit.x=TRUEis needed if runningblrmStatsfor example.- y
set to
FALSEto not store the response variable in the fit
Details
The designated-start profile and fitted-patient eligibility contract
is the same as for orm_markov(). In particular, the transition response
at the starting row may be missing when that patient contributes another
usable likelihood transition.
A subset supplied through ... is evaluated once when the model is
fitted, looking first in data and then where blrm_markov() was called.
