plot estimate at each lag and confidence intervals using ggplot2
tidy_lag_plot.Rd
plot estimate at each lag and confidence intervals using ggplot2
Usage
tidy_lag_plot(
lag_fits,
continuous = TRUE,
shading = FALSE,
shade_colors = c("red", NA, "blue")
)
Arguments
- lag_fits
tibble containing lag, estimate, and lower and upper bounds of confidence intervals; most likely output from [
tidydlnm::tidy_lag_fits()``] or [
tidydlnm::tidy_cumul_fits()``]- continuous
logical. When TRUE, creates a plot with
ggplot2::geom_line()
andggplot2::geom_ribbon()
(used whenarglag
is a continuous function). When FALSE, creates a plot withggplot2::geom_pointrange()
(used whenarglag
is not a continuous function -- eg, 'integer' or 'strata')- shading
logical. When TRUE, adds colored shading to the regions of the plot corresponding to significant associations as defined by the signSum variable of lag_fits
- shade_colors
vector of three colors desired to shade the regions of negative, null, and positive association, respectively.