Description Usage Arguments Value References Examples
Description.
1 2 3 4 5 |
model |
the model. |
treatment |
character vector with the treatment variable. |
benchmarks |
character vector with the covariates for benchmarking. |
... |
extra arguments |
group_list |
a list of character vectors where elements within one vector are terms that should be grouped. |
The function returns an object of class 'sensemakr' which is a list with the main results for sensitivity analysis, namely:
Treat Stats |
A list with the main statistics of the treatment estiamate which are needed for computing the sensitivity.
|
Benchmarks |
Benchmark values for the covariates listed on paramter X
|
Cite paper(s)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | rm(list = ls())
# library
library(sensemakr)
# loads data
data("darfur")
# fits model
model <- lm(peacefactor ~ directlyharmed + age + farmer_dar + herder_dar +
pastvoted + hhsize_darfur + female + village, data = darfur)
# benchmark variables
X = c("herder_dar", "female", "age", "pastvoted", "farmer_dar")
# runs benchmarking etc
sense <- sensemakr(model, treatment = "directlyharmed", benchmarks = X)
# plots
## contour plot
plot1_data <- plot(sense)
plot2_data <- plot(sense, contour = "t-value")
plot3_data <- plot(sense, contour = "lower bound")
plot4_data <- plot(sense, contour = "upper bound")
## worst-case plot
plot5_data <- plot(sense, type = "worst-case")
# testing verbal outputs
interpret(sense)
interpret(sense, q = 0.6)
summary(sense)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.