sens_plot | R Documentation |
sens_plot
plots the sensitivity analysis for cutpoints or bandwidths.
sens_plot(
sim_results,
level = 0.95,
x = c("A1", "A2", "bw"),
plot_models = unique(sim_results$model),
yrange = NULL
)
sim_results |
A |
level |
A numeric value between 0 and 1 specifying the confidence level for CIs (assuming a normal sampling distribution). The default is 0.95. |
x |
A string of the column name of the varying parameter in |
plot_models |
A character vector specifying the models to be plotted (i.e. models estimated with
different approaches). Possible values are |
yrange |
An optional numeric vector specifying the range of the y-axis. |
set.seed(12345)
x <- runif(1000, -1, 1)
cov <- rnorm(1000)
y <- 3 + 2 * x + 3 * cov + 10 * (x >= 0) + rnorm(1000)
m <- rd_est(y ~ x | cov, t.design = "geq")
sim_cutoff <- rd_sens_cutoff(m, seq(-.5, .5, length.out = 10))
sens_plot(sim_cutoff, x = "A1", plot_models = c("linear", "optimal"))
sim_bw <- rd_sens_bw(m, seq(.1, 1, length.out = 10))
sens_plot(sim_bw, x = "bw")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.