Learn R Programming

sensemakr (version 0.1.2)

print.sensemakr: Sensitivity analysis print and summary methods for sensemakr

Description

The print and summary methods provide verbal descriptions of the sensitivity analysis results obtained with the function sensemakr. The function ovb_minimal_reporting provides the latex code for a minimal sensitivity analysis reporting, as suggested in Cinelli and Hazlett (2018).

Usage

# S3 method for sensemakr
print(x, digits = max(3L, getOption("digits") - 2L),
  ...)

# S3 method for sensemakr summary(object, digits = max(3L, getOption("digits") - 3L), ...)

ovb_minimal_reporting(x, digits = 3, verbose = TRUE, ...)

Arguments

x

an object of class sensemakr.

digits

minimal number of significant digits.

...

arguments passed to other methods.

object

an object of class sensemakr.

verbose

if `TRUE`, the function prints the LaTeX code with cat

Value

The function ovb_minimal_reporting returns the LaTeX code invisibly in character form and also prints with cat the LaTeX code. To suppress automatic printing, set verbose = FALSE.

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)

# runs sensemakr for sensitivity analysis
sensitivity <- sensemakr(model, treatment = "directlyharmed",
                               benchmark_covariates = "female",
                               kd = 1:3)
# print
sensitivity

# summary
summary(sensitivity)

# prints latex code for minimal sensitivity analysis reporting
ovb_minimal_reporting(sensitivity)

# }

Run the code above in your browser using DataLab