ggs_ppmean: Posterior predictive plot comparing the outcome mean vs the...

Description Usage Arguments Value References Examples

View source: R/ggs_ppmean.R

Description

Histogram with the distribution of the predicted posterior means, compared with the mean of the observed outcome.

Usage

1
ggs_ppmean(D, outcome, family = NA, bins = 30)

Arguments

D

Data frame whith the simulations. Notice that only the posterior outcomes are needed, and so either the ggs() call limits the parameters to the outcomes or the user provides a family of parameters to limit it.

outcome

vector (or matrix or array) containing the observed outcome variable. Currently only a vector is supported.

family

Name of the family of parameters to plot, as given by a character vector or a regular expression. A family of parameters is considered to be any group of parameters with the same name but different numerical value between square brackets (as beta[1], beta[2], etc).

bins

integer indicating the total number of bins in which to divide the histogram. Defaults to 30, which is the same as geom_histogram()

Value

A ggplot object.

References

Fernández-i-Marín, Xavier (2016) ggmcmc: Analysis of MCMC Samples and Bayesian Inference. Journal of Statistical Software, 70(9), 1-20. doi:10.18637/jss.v070.i09

Examples

1
2

Example output

Loading required package: dplyr

Attaching package: 'dplyr'

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

Loading required package: tidyr
Loading required package: ggplot2

ggmcmc documentation built on Feb. 10, 2021, 5:10 p.m.