Description Usage Arguments Value Examples
Takes the results of DOPE and plots how the uncertainty changes with various restrictions on the R-squared.
1 | sensitivity_plot(output,vname,adj=NULL)
|
output |
data.frame of simulations, usually from DOPE |
vname |
character or column index. Which distribution would you like to see? |
adj |
numeric. Set y-axis lower bound. |
Returns a ggplot object.
The solid dots indicate how the certainty in the effect changes as you say "the world is not that deterministic," reducing the maximum allowable R-squared. This reduces uncertainty relative to ignornace, indicated by the dashed line, at the cost of restrictiveness, indicated by the hollow points.
In the other direction, one might say that "the world is more deterministic than reflected in my model." This is represented by the crossed points and increases uncertainty until the lower pessimistic bound on effect certainty. The proportion of draws rejected by this lower thresholding is given by the filled diamonds.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | set.seed(8675309)
x_vars <- 5
n_obs <- 1000
corm <- RandomCormCPP(nvars = x_vars)
X_mat <- MASS::mvrnorm(n_obs, rep(0,x_vars), Sigma = corm, empirical = TRUE)
betas <- 1:x_vars
y <- X_mat
dat <- data.frame(y,X_mat)
mod <- lm(y ~ ., data=dat)
dope <- DOPE(mod, nsims = 3000, n.cores = parallel::detectCores())
sensitivity_plot(dope,"V2")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.