regressionBF
computes Bayes factors to test the
hypothesis that slopes are 0 against the alternative that
all slopes are nonzero. The vector of observations $y$ is assumed to be
distributed as $$y ~ Normal(\alpha 1 + X\beta,
\sigma^2 I).$$ The joint prior on $\alpha,\sigma^2$ is
proportional to $1/\sigma^2$, the prior on
$\beta$ is $$\beta ~ Normal(0, N g
\sigma^2(X'X)^{-1}).$$ where $g ~
InverseGamma(1/2,r/2)$. See Liang et al. (2008) section 3
for details.
Possible values for whichModels
are 'all', 'top',
and 'bottom', where 'all' computes Bayes factors for all
models, 'top' computes the Bayes factors for models that
have one covariate missing from the full model, and
'bottom' computes the Bayes factors for all models
containing a single covariate. Caution should be used
when interpreting the results; when the results of 'top'
testing is interpreted as a test of each covariate, the
test is conditional on all other covariates being in the
model (and likewise 'bottom' testing is conditional on no
other covariates being in the model).
An option is included to prevent analyzing too many
models at once: options('BFMaxModels')
, which
defaults to 50,000, is the maximum number of models that
`anovaBF` will analyze at once. This can be increased by
increasing the option value.