plot.clarify_adrf() plots the output of sim_adrf(). For the average dose-response function (ADRF, requested with contrast = "adrf" in sim_adrf()), this is a plot of the average marginal mean of the outcome against the requested values of the focal predictor; for the average marginal effects function (AMEF, requested with contrast = "amef" in sim_adrf()), this is a plot of the instantaneous average marginal effect of the focal predictor on the outcome against the requested values of the focal predictor.
Usage
# S3 method for class 'clarify_adrf'
plot(
x,
ci = TRUE,
level = 0.95,
method = "quantile",
baseline = NULL,
color = "black",
simultaneous = FALSE,
...
)Arguments
- x
a
clarify_adrfobject resulting from a call tosim_adrf().- ci
logical; whether to display confidence bands for the estimates. Default isTRUE.- level
the confidence level desired. Default is .95 for 95% confidence intervals.
- method
the method used to compute confidence bands. Can be
"wald"to use a Normal approximation or"quantile"to use the simulated sampling distribution (default). Seesummary.clarify_est()for details. Abbreviations allowed.- baseline
logical; whether to include a horizontal line aty = 0on the plot. Default isFALSEfor the ADRF (since 0 might not be in the range of the outcome) andTRUEfor the AMEF.- color
the color of the line and confidence band in the plot.
- simultaneous
logical; whether confidence bands should be simultaneous or not (i.e., for nominal coverage of the whole effect curve); default isFALSE, butTRUEis recommended. See Details atsummary.clarify_est()for details.- ...
for
plot(), further arguments passed toggplot2::geom_density().
Details
These plots are produced using ggplot2::geom_line() and ggplot2::geom_ribbon(). The confidence bands should be interpreted pointwise (i.e., they do not account for simultaneous inference) unless simultaneous = TRUE.
See also
summary.clarify_est() for computing p-values and confidence intervals for the estimated quantities.