Learn R Programming

evidence (version 0.8.10)

Bregbf: Bayesian regression model comparison with Bayes factors.

Description

This function compares different linear models on the basis of their Bayes factors and by graphically comparing posterior model probabilities.

Usage

Bregbf(form.list, data, l=length(form.list))

Arguments

form.list

a list of linear models, each expressed by a model formula, that should be compared; the models must all be applicable to the same data frame and use the same response variable

data

a data frame to be analyzed

l

the number of models to be compared; defaults to all models in the form.list

Value

A list with model parameter probabilities is silently returned.

Details

Note that a list containing several appropriate models for the data frame should be prepared beforehand. See the example for how to do this.

References

van Hulst, R. 2018. Evaluating Scientific Evidence. ms.

Examples

Run this code
# NOT RUN {
data(PlantGrowth)
frmlst <- list(
model0 = formula(weight ~ 1),
model1 = formula(weight ~ group) )
Bregbf(form.list=frmlst, data=PlantGrowth)
data(fev)
frmlst.fev <- list(
formula(FEV ~ Age),
formula(FEV ~ Smoke),
formula(FEV ~ Age + Smoke),
formula(FEV ~ Age * Smoke)
)
Bregbf(frmlst.fev, fev)
# }

Run the code above in your browser using DataLab