Estimate the emulated trial effect
emul_estimate(
clones_weighted,
method = c("Cox", "logistic", "KM"),
cluster = "id",
weights = NULL,
predictors = NULL,
outcome = "outcome",
time_start = "Tstart",
time_stop = "Tstop",
arm = "arms"
)A named list of weighted clone data frames, or a single data frame containing an arm column.
Analysis method: "Cox", "logistic", or "KM".
Column name used for robust clustering in Cox models.
Optional weight column name. Unquoted column names are also accepted when they exist in the data.
Optional adjustment predictors. For KM, predictors define additional strata rather than covariate adjustment.
Column name for the outcome indicator.
Column name for interval start time.
Column name for interval stop time.
Column name for treatment arm after binding clone lists.
A fitted model object: "coxph" for Cox, "glm" for logistic, or
"survfit" for KM.
data(lungcancer)
arms <- c("Control", "Surgery")
clones <- clone_arms(lungcancer, arms)
policies <- create_policy_A(
arms, "surgery", "timetosurgery", 182.62, "death", "fup_obs",
clone_outcome = "outcome", clone_followup = "fup"
)
clones_policy <- apply_logics(clones, policies)
censoring_logics <- create_censoring_logics_A(
arms, "surgery", "timetosurgery", 182.62, "fup_obs",
clone_censoring = "censoring",
clone_uncensored_followup = "fup_uncensored"
)
clones_censored <- apply_logics(clones_policy, censoring_logics)
clones_final <- create_final_data(
clones_censored, "fup", "outcome", "censoring", "id"
)
clones_estimated <- estimate_censoring(
clones_final,
predictors = c("age", "sex"),
method = "pooled_logit"
)
clones_weighted <- weight_cases(clones_estimated)
fit <- emul_estimate(
clones_weighted,
method = "Cox",
weights = "weight_Cox",
predictors = c("age", "sex")
)