# loads data
data("darfur")
# fits model
model <- lm(peacefactor ~ directlyharmed + age +
farmer_dar + herder_dar +
pastvoted + hhsize_darfur +
female + village, data = darfur)
# computes adjusted estimate for confounder with r2dz.x = 0.05, r2yz.dx = 0.05
adjusted_estimate(model, treatment = "directlyharmed", r2dz.x = 0.05, r2yz.dx = 0.05)
# computes adjusted SE for confounder with r2dz.x = 0.05, r2yz.dx = 0.05
adjusted_se(model, treatment = "directlyharmed", r2dz.x = 0.05, r2yz.dx = 0.05)
# computes adjusted t-value for confounder with r2dz.x = 0.05, r2yz.dx = 0.05
adjusted_t(model, treatment = "directlyharmed", r2dz.x = 0.05, r2yz.dx = 0.05)
# Alternatively, pass in numerical values directly.
adjusted_estimate(estimate = 0.09731582, se = 0.02325654,
dof = 783, r2dz.x = 0.05, r2yz.dx = 0.05)
adjusted_se(estimate = 0.09731582, se = 0.02325654,
dof = 783, r2dz.x = 0.05, r2yz.dx = 0.05)
adjusted_t(estimate = 0.09731582, se = 0.02325654,
dof = 783, r2dz.x = 0.05, r2yz.dx = 0.05)
Run the code above in your browser using DataLab