Learn R Programming

BMS (version 0.3.4)

topmodels.bma: Model Binaries and their Posterior model Probabilities

Description

Returns a matrix whose columns show which covariates were included in the best models in a 'bma' object. The last two columns detail posterior model probabilities.

Usage

topmodels.bma(bmao)

Arguments

bmao
an object of class 'bma' - see bms

Value

Each column in the resulting matrix corresponds to one of the 'best' models in bmao: the first column for the best model, the second for the second-best model, etc.The model binaries have elements 1 if the regressor given by the row name was included in the respective models, and 0 otherwise.The second-last row shows the model's posterior model probability based on marginal likelihoods (i.e. its marginal likelihood over the sum of likelihoods of all best models)The last row shows the model's posterior model probability based on MCMC frequencies (i.e. how often the model was accepted vs sum of acceptance of all models)

See Also

topmod for accessing model binaries, pmp.bma for posterior model probabilities

Check http://bms.zeugner.eu for additional help.

Examples

Run this code
data(datafls)
#sample with a limited data set for demonstration
mm=bms(datafls[,1:12],nmodel=20)

#show binaries for all
topmodels.bma(mm)

#show binaries for 2nd and 3rd best model, without the model probs
topmodels.bma(mm[2:3])[1:11,]

#access model binaries directly
mm$topmod$bool_binary()

Run the code above in your browser using DataLab