df_observed <- data_observed(
data = df_uc_em_sel,
exposure = "Xstar",
outcome = "Y",
confounders = c("C1", "C2", "C3")
)
# Using validation data -----------------------------------------------------
df_validation <- data_validation(
data = df_uc_em_sel_source,
true_exposure = "X",
true_outcome = "Y",
confounders = c("C1", "C2", "C3", "U"),
misclassified_exposure = "Xstar",
selection = "S"
)
adjust_uc_em_sel(
data_observed = df_observed,
data_validation = df_validation
)
# Using u_model_coefs, x_model_coefs, s_model_coefs -------------------------
adjust_uc_em_sel(
data_observed = df_observed,
u_model_coefs = c(-0.32, 0.59, 0.69),
x_model_coefs = c(-2.44, 1.62, 0.72, 0.32, -0.15, 0.85),
s_model_coefs = c(0.00, 0.26, 0.78, 0.03, -0.02, 0.10)
)
# Using x1u0_model_coefs, x0u1_model_coefs, x1u1_model_coefs, s_model_coefs
adjust_uc_em_sel(
data_observed = df_observed,
x1u0_model_coefs = c(-2.78, 1.62, 0.61, 0.36, -0.27, 0.88),
x0u1_model_coefs = c(-0.17, -0.01, 0.71, -0.08, 0.07, -0.15),
x1u1_model_coefs = c(-2.36, 1.62, 1.29, 0.25, -0.06, 0.74),
s_model_coefs = c(0.00, 0.26, 0.78, 0.03, -0.02, 0.10)
)
Run the code above in your browser using DataLab