Bregbf: Bayesian regression model comparison with Bayes factors.

Description Usage Arguments Details Value Author(s) References Examples

View source: R/Bregbf.R

Description

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

Usage

1
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

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.

Value

A list with model parameter probabilities is silently returned.

Author(s)

Robert van Hulst

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## 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)

## End(Not run)

evidence documentation built on May 2, 2019, 2:14 p.m.