Learn R Programming

sensemakr (version 0.1.2)

ovb_bounds: Bounds on the strength of unobserved confounders using observed covariates

Description

Bounds on the strength of unobserved confounders using observed covariates, as in Cinelli and Hazlett (2018).

Usage

ovb_bounds(...)

# S3 method for lm ovb_bounds(model, treatment, benchmark_covariates, kd = 1, ky = kd, reduce = TRUE, bound = c("partial r2", "partial r2 no D", "total r2"), adjusted_estimates = TRUE, ...)

Arguments

...

arguments passed to other methods. First argument should either be an lm model with the outcome regression, or a formula describing the model along with the data.frame containing the variables of the model.

model

An lm object with the outcome regression.

treatment

A character vector with the name of the treatment variable of the model.

benchmark_covariates

a character vector of the names of covariates that will be used to bound the plausible strength of the unobserved confounders.

kd

numeric vector. Parameterizes how many times stronger the confounder is related to the treatment in comparison to the observed benchmark covariate. Default value is 1 (confounder is as strong as benchmark covariate).

ky

numeric vector. Parameterizes how many times stronger the confounder is related to the outcome in comparison to the observed benchmark covariate. Default value is the same as kd.

reduce

Should the bias adjustment reduce or increase the absolute value of the estimated coefficient? Default is TRUE.

bound

type of bounding procedure. Currently only "partial r2" is implemented.

adjusted_estimates

should the bounder also compute the adjusted estimates? Default is TRUE.

Value

The function returns a data.frame with the bounds on the strength of the unobserved confounder as well with the adjusted point estimates, standard errors and t-values (optional, controlled by argument adjusted_estimates).

Details

Currently it implements only the bounds based on partial R2. Other bounds will be implemented soon.

References

Cinelli, C. and Hazlett, C. "Making Sense of Sensitivity: Extending Omitted Variable Bias." (2018).

Examples

Run this code
# NOT RUN {
# runs regression model
model <- lm(peacefactor ~ directlyharmed + age + farmer_dar + herder_dar +
             pastvoted + hhsize_darfur + female + village, data = darfur)

# bounds on the strength of confounders 1, 2, or 3 times as strong as female
# and 1,2, or 3 times as strong as pastvoted
ovb_bounds(model, treatment = "directlyharmed",
          benchmark_covariates = c("female", "pastvoted"),
          kd = 1:3)

# }

Run the code above in your browser using DataLab