plot.flexreg_postpred: Plot Method for ”flexreg_postpred” objects

View source: R/posterior_predictive.R

plot.flexreg_postpredR Documentation

Plot Method for `flexreg_postpred` objects

Description

Method for an object of class `flexreg_postpred` containing the simulated posterior predictive distribution, usually the result of posterior_predict function. The plot shows the posterior predictive interval for each statistical unit. Additionally, the mean of the posterior predictives and the values of the observed response (either y or y/n for bounded continuous or discrete responses, respectively) can be added.

Usage

## S3 method for class 'flexreg_postpred'
plot(x, prob = 0.9, p_mean = F, response = NULL, ...)

Arguments

x

an object of class `flexreg_postpred` containing the simulated posterior predictives, usually the result of posterior_predict.

prob

the interval probability for the posterior predictives (default is 0.9).

p_mean

a logical value indicating whether the posterior predictives' mean should be plotted.

response

a numerical vector containing the response (either y or y/n for bounded continuous or discrete responses, respectively) to be added to the plot. If NULL, observed values are not plotted.

...

additional arguments. Currently not used.

Examples

## Not run: 
data("Reading")
FB <- flexreg(accuracy ~ iq, data = Reading)
pp <- posterior_predict(FB)
plot(pp)

## End(Not run)


FlexReg documentation built on Sept. 29, 2023, 9:06 a.m.