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

View source: R/print.R

print.sensemakrR Documentation

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 latex or html code for a minimal sensitivity analysis reporting, as suggested in Cinelli and Hazlett (2020).

Usage

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

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

ovb_minimal_reporting(
  x,
  digits = 3,
  verbose = TRUE,
  format = c("latex", "html", "pure_html"),
  ...
)

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

format

code format to print, either latex or html. The default html version has some mathematical content that requires mathjax or equivalent library to parse. If you need only html, use the option "pure_html".

Value

The function ovb_minimal_reporting returns the LaTeX/HTML 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. (2020), "Making Sense of Sensitivity: Extending Omitted Variable Bias." Journal of the Royal Statistical Society, Series B (Statistical Methodology).

Examples

# 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)


sensemakr documentation built on Sept. 11, 2024, 6:18 p.m.