The classes and (internal) methods defined for using stats::glm to fit the logistic regression models.
# S4 method for te_stats_glm_logit
fit_weights_model(object, data, formula, label)# S4 method for te_stats_glm_logit
fit_outcome_model(object, data, formula, weights = NULL)
# S4 method for te_stats_glm_logit_outcome_fitted
predict(
object,
newdata,
predict_times,
conf_int = TRUE,
samples = 100,
type = c("cum_inc", "survival")
)
Object to dispatch method on
data.frame
containing outcomes and covariates as defined in formula
.
formula
describing the model.
A short string describing the model.
numeric
vector of weights.
Baseline trial data that characterise the target trial population that marginal cumulative incidences
or survival probabilities are predicted for. newdata
must have the same columns and formats of variables as in
the fitted marginal structural model specified in trial_msm()
or initiators()
. If newdata
contains rows with
followup_time > 0
these will be removed.
Specify the follow-up visits/times where the marginal cumulative incidences or survival probabilities are predicted.
Construct the point-wise 95-percent confidence intervals of cumulative incidences for the target trial population under treatment and non-treatment and their differences by simulating the parameters in the marginal structural model from a multivariate normal distribution with the mean equal to the marginal structural model parameter estimates and the variance equal to the estimated robust covariance matrix.
Number of samples used to construct the simulation-based confidence intervals.
Specify cumulative incidences or survival probabilities to be predicted. Either cumulative incidence
("cum_inc"
) or survival probability ("survival"
).
fit_weights_model(te_stats_glm_logit)
: Fit the weight models object via calculate_weights on trial_sequence
fit_outcome_model(te_stats_glm_logit)
: Fit the outcome model object via fit_msm on trial_sequence
predict(te_stats_glm_logit_outcome_fitted)
: Predict from the fitted model object via predict on trial_sequence
Other model_fitter_classes:
te_parsnip_model-class