View source: R/plot_boot_density.R
plot_boot_density | R Documentation |
Make density plots of bootstrapped parameters and add quantiles as vertical lines.
plot_boot_density(
data,
x_name,
density_args = list(from = NULL, to = NULL),
plot_args = list(xlab = NULL, ylab = "density", main = "", type = "l"),
quantile_draw = FALSE,
quantile_args = list(probs = c(0.05, 0.5, 0.95)),
quantile_abline_args = list(lty = c(3, 2, 3), lwd = c(2, 2, 2), lend = "butt"),
col_shade = "gray50",
add_text_nsim = FALSE
)
data |
a numeric matrix or data frame that can be coerced to a numeric matrix where rows are runs and columns represent parameters or variables. |
x_name |
column name of a variable x to plot |
density_args |
arguments passed to |
plot_args |
arguments passed to |
quantile_draw |
logical. Should quantiles of x be added to the plot as vertical lines? (e.g. confidence limits and median) |
quantile_args |
arguments passed to |
quantile_abline_args |
arguments to pass to |
col_shade |
color for shading density region |
add_text_nsim |
logical. Should the number of simulation runs (nsim) in |
Nikolai Klibansky
## Not run:
nsim <- 100
data <- data.frame("M"=runif(nsim,0.19, 2.1),"lwb"=rnorm(nsim,mean=3))
par(mfrow=c(2,2))
plot_boot_density(data,"M")
plot_boot_density(data,"M",add_text_nsim = TRUE)
plot_boot_density(data,"lwb")
plot_boot_density(data,"lwb",add_text_nsim = TRUE,quantile_draw=TRUE,col_shade=rgb(0,0,1,0.5))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.