df_observed <- data_observed(
data = df_uc_em,
exposure = "Xstar",
outcome = "Y",
confounders = "C1"
)
# Using validation data -----------------------------------------------------
df_validation <- data_validation(
data = df_uc_em_source,
true_exposure = "X",
true_outcome = "Y",
confounders = c("C1", "U"),
misclassified_exposure = "Xstar",
)
adjust_uc_em(
data_observed = df_observed,
data_validation = df_validation
)
# Using u_model_coefs and x_model_coefs -------------------------------------
adjust_uc_em(
data_observed = df_observed,
u_model_coefs = c(-0.23, 0.63, 0.66),
x_model_coefs = c(-2.47, 1.62, 0.73, 0.32)
)
# Using x1u0_model_coefs, x0u1_model_coefs, x1u1_model_coefs ----------------
adjust_uc_em(
data_observed = df_observed,
x1u0_model_coefs = c(-2.82, 1.62, 0.68, -0.06),
x0u1_model_coefs = c(-0.20, 0.00, 0.68, -0.05),
x1u1_model_coefs = c(-2.36, 1.62, 1.29, 0.27)
)
Run the code above in your browser using DataLab