mombf | R Documentation |
mombf
computes moment Bayes factors to test whether a subset of
regression coefficients are equal to some user-specified value.
imombf
computes inverse moment Bayes factors.
mombf(lm1, coef, g, prior.mode, baseDensity='normal', nu=3, theta0,
logbf=FALSE, B=10^5)
imombf(lm1, coef, g, prior.mode, nu = 1, theta0 , method='adapt',
nquant=100, B = 10^5)
lm1 |
Linear model fit, as returned by |
coef |
Vector with indexes of coefficients to be
tested. e.g. |
g |
Vector with prior parameter values. See |
prior.mode |
If specified, |
baseDensity |
Density upon which the Mom prior is
based. |
nu |
For |
theta0 |
Null value for the regression coefficients. Defaults to 0. |
logbf |
If |
method |
Numerical integration method to compute the bivariate
integral (only used by |
nquant |
Number of quantiles at which to evaluate the integral
for known |
B |
Number of Monte Carlo samples to estimate the T Mom and the inverse moment
Bayes factor. Only used in |
These functions actually call momunknown
and
imomunknown
, but they have a simpler interface.
See dmom
and dimom
for details on the moment and inverse
moment priors.
mombf
returns the moment Bayes factor to compare the model where
theta!=theta0
with the null model where theta==theta0
. Large values favor the
alternative model; small values favor the null.
imombf
returns
inverse moment Bayes factors.
David Rossell
See http://rosselldavid.googlepages.com for technical reports. For details on the quantile integration, see Johnson, V.E. A Technique for Estimating Marginal Posterior Densities in Hierarchical Models Using Mixtures of Conditional Densities. Journal of the American Statistical Association, Vol. 87, No. 419. (Sep., 1992), pp. 852-860.
nlpMarginal
for a better interface to
integrated likelihoods and modelSelection
to also
search over the model space
##compute Bayes factor for Hald's data
data(hald)
lm1 <- lm(hald[,1] ~ hald[,2] + hald[,3] + hald[,4] + hald[,5])
# Set g so that interval (-0.2,0.2) has 5% prior probability
# (in standardized effect size scale)
priorp <- .05; q <- .2
gmom <- priorp2g(priorp=priorp,q=q,prior='normalMom')
gimom <- priorp2g(priorp=priorp,q=q,prior='iMom')
mombf(lm1,coef=2,g=gmom) #moment BF
imombf(lm1,coef=2,g=gimom,B=10^5) #inverse moment BF
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.