posterior_summary: Summaries of posterior model probabilities function

View source: R/bmediatR.R

posterior_summaryR Documentation

Summaries of posterior model probabilities function

Description

This function takes the log posterior probability of the data (posterior likelihood) for the various cases, the log prior case probabilities, and returns log posterior odds.

Usage

posterior_summary(ln_prob_data, ln_prior_c, c_numerator)

Arguments

ln_prob_data

Log posterior likelihoods under the various models, returned by bmediatR().

ln_prior_c

Log prior case probabilities. If posterior_summary() is being used for a non-default posterior odds summary, the log prior case probabilities used with bmediatR() are stored in its output.

c_numerator

The index of cases to be summed in the numerator of the posterior odds. Cases, their order, and likelihoods are provided in model_info().

Value

posterior_summary returns a list containing the following components:

ln_post_c

a matrix with posterior probabilities of each causal model for each candidate mediator.

ln_post_odds

a matrix with posterior odds of individual models or combinations of models for each candidate mediator.

ln_prior_odds

a single row matrix with prior odds of individual models or combinations of models.

ln_ml

the natural log of the marginal likelihood.

Examples

posterior_summary()

wesleycrouse/bmediatR documentation built on April 28, 2023, 4:01 p.m.