bain_sensitivity {bain} | R Documentation |
Conducts a sensitivity analysis for bain
.
bain_sensitivity(x, hypothesis, fractions = 1, ...)
x |
An R object containing the outcome of a statistical analysis.
Currently, the following objects can be processed: |
hypothesis |
A character string containing the informative hypotheses to evaluate. See the vignette for elaborations. |
fractions |
A numeric vector, representing the fractions of information in the data to be used to construct the prior distribution (see the tutorial DOI: 10.1037/met0000201): The default value 1 denotes the minimal fraction, 2 denotes twice the minimal fraction, etc. |
... |
Additional arguments passed to |
The Bayes factor for equality constraints is sensitive to a
scaling factor applied to the prior distribution. The argument
fraction
adjusts this scaling factor. The function
bain_sensitivity
is a wrapper for bain
, which accepts a vector for the
fractions
argument, and returns a list of bain results objects.
A table with a sensitivity analysis for specific statistics can be obtained
using the summary()
function, which accepts the argument
summary(which_stat = ...)
. The available statistics are elements of
the $fit
table (Fit_eq, Com_eq, Fit_in, Com_in, Fit, Com, BF, PMPa,
and PMPb), and elements of the
BFmatrix
, which can be accessed by matrix notation, e.g.:
summary(bain_sens, which_stat = "BFmatrix[1,2]")
.
A data.frame
of class "bain_sensitivity"
.
sesamesim$site <- as.factor(sesamesim$site) res <- lm(sesamesim$postnumb~sesamesim$site-1) set.seed(4583) bain_sens <- bain_sensitivity(res, "site1=site2=site3=site4=site5; site2>site5>site1>site3=site4; site1=site2>site3=site4>site5", fractions = c(1,2,3)) summary(bain_sens, which_stat = "BF.c") summary(bain_sens, which_stat = "BFmatrix[1,3]")