Learn R Programming

MDMA (version 2.0.0)

pMM: Posterior model probability

Description

Calculate the posterior model probability for a set of models.

[Stable]

Usage

pMM(...)

Value

pMM returns to posterior model probabilities for the models provided.

Arguments

...

objects of class (g)lm, given as separate arguments.

Author

Mathijs Deen

Details

Posterior model probabilities are calculated for every model \(i\) as $$\mathrm{pMO}_i = \frac{\mathrm{exp}\Big[-\frac{1}{2}\Delta_i\mathrm{BIC}\Big]}{\sum_{j = 1}^K\mathrm{exp}\Big[-\frac{1}{2}\Delta_j\mathrm{BIC}\Big]},$$ where the minimal BIC value is subtracted from all BICs. In other words: the model with the lowest BIC has \(\Delta\mathrm{BIC}=0\).

Examples

Run this code
lm.1 <- lm(mpg ~ hp + wt, data = mtcars)
lm.2 <- lm(mpg ~ hp * wt, data = mtcars)
lm.3 <- lm(mpg ~ hp * wt + gear, data = mtcars)
pMM(lm.1, lm.2, lm.3)

Run the code above in your browser using DataLab