Description Usage Arguments Value Examples
Posterior predictive contrast
1 | pp_contrast(stanreg, cdata, ccoef, width = 0.95, yfun = median, ...)
|
stanreg |
stanreg object from rstanarm. |
cdata |
a list of data sets to use to find posterior predictions of each. |
ccoef |
contrast coefficients corresponding to the order of the data
sets in |
width |
confidence interval width. Sent to the |
yfun |
the stat function to use to collapse the predictions into a
scalar value. Corresponds to the average of the predicted responses for each
data set in |
... |
additional parameters passed to the function |
list containing the confidence interval and posterior predictive contrast difference
1 2 3 4 5 6 7 8 | stanreg <- example_stanreg()
cdata <- list(
c1 = contrast_data(stanreg, TRUE, margin_ignore = 'floor', subset_expression = .~ log_uranium < -0.5),
c2 = contrast_data(stanreg, TRUE, margin_ignore = 'floor', subset_expression = .~ log_uranium >= -0.5 & log_uranium <= 0.5),
c3 = contrast_data(stanreg, TRUE, margin_ignore = 'floor', subset_expression = .~ log_uranium > 0.5))
my_contrast <- pp_contrast(stanreg, cdata, c(-1, 0.5, 0.5))
my_contrast$ci
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.