Description Usage Arguments Value Author(s) Examples
Using Zellner's G priors, computes the log marginal density for all possible regression models
1 | bayes.model.selection(y, X, c, constant=TRUE)
|
y |
vector of response values |
X |
matrix of covariates |
c |
parameter of the G prior |
constant |
logical variable indicating if a constant term is in the matrix X |
mod.prob |
data frame specifying the model, the value of the log marginal density and the value of the posterior model probability |
converge |
logical vector indicating if the laplace algorithm converged for each model |
Jim Albert
1 2 3 4 | data(birdextinct)
logtime=log(birdextinct$time)
X=cbind(1,birdextinct$nesting,birdextinct$size,birdextinct$status)
bayes.model.selection(logtime,X,100)
|
$mod.prob
log.m Prob NA NA NA
1 FALSE FALSE FALSE -92.05 0.00000
2 TRUE FALSE FALSE -77.39 0.00355
3 FALSE TRUE FALSE -90.39 0.00000
4 TRUE TRUE FALSE -73.26 0.21985
5 FALSE FALSE TRUE -90.38 0.00000
6 TRUE FALSE TRUE -76.51 0.00854
7 FALSE TRUE TRUE -88.51 0.00000
8 TRUE TRUE TRUE -72.01 0.76806
$converge
[1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.