The formulation of the null and alternative hypotheses for the
non-inferiority design differs depending on whether high or low scores on the
dependent variable represent non-inferiority. In the case where high scores
correspond to non-inferiority, the hypotheses are as follows: The null
hypothesis states that the population mean of the experimental group (e.g., a
new medication) is lower than the population mean of the control group (e.g.,
a placebo or an already existing medication) minus the non-inferiority
margin. The alternative hypothesis states that the population mean of the
experimental group is higher than the population mean of the control group
minus the non-inferiority margin. Thus, the null hypothesis goes in the
negative direction (i.e., H-) and the alternative hypothesis in the positive
direction (i.e., H+). In turn, in the case where low scores correspond to
non-inferiority, the hypotheses are as follows: The null hypothesis states
that the population mean of the experimental group is higher than the
population mean of the control group plus the non-inferiority margin. The
alternative hypothesis states that the population mean of the experimental
group is lower than the population mean of the control group plus the
non-inferiority margin. Thus, the null hypothesis goes in the positive
direction (i.e., H+) and the alternative hypothesis in the negative direction
(i.e., H-). The dependent variable must be continuous.
Since the main goal of infer_bf is to establish
non-inferiority, the resulting Bayes factor quantifies evidence in favor of
the alternative hypothesis. In the case where high values represent
non-inferiority we have BF+- and in the case where low values represent
non-inferiority we have BF-+. Evidence for the null hypothesis can easily be
calculated by taking the reciprocal of the original Bayes factor (i.e., BF+-
= 1 / BF-+ and vice versa). Quantification of evidence in favor of the null
hypothesis is logically sound and legitimate within the Bayesian framework
(see e.g., van Ravenzwaaij et al., 2019).
infer_bf can be utilized to calculate a Bayes factor based on
raw data (i.e., if arguments x and y are defined) or summary
statistics (i.e., if arguments n_x, n_y, mean_x, and
mean_y (or ci_margin and ci_level instead of sd_x
and sd_y) are defined). Arguments with 'x' as a name or suffix
correspond to the control group, whereas arguments with 'y' as a name or
suffix correspond to the experimental group.
Since sometimes high scores on the dependent variable are considered
non-inferior (e.g., amount of social interactions) and sometimes rather the
low scores (e.g., severity of symptoms), the direction of non-inferiority can
be specified with the argument direction. For the case where high
values on the dependent variable indicate non-inferiority, 'high' (the
default) should be specified for the argument direction; if low values
on the dependent variable indicate non-inferiority, 'low' should be specified
for the argument direction.
With the argument ni_margin, the non-inferiority margin can be
specified. ni_margin should be a positive number.' It can be declared
whether the non-inferiority margin is specified in standardized or
unstandardized units with the ni_margin_std argument, where TRUE,
corresponding to standardized units, is the default.
For the calculation of the Bayes factor, a Cauchy prior density centered on 0
is chosen for the effect size under the alternative hypothesis. The standard
Cauchy distribution, with a location parameter of 0 and a scale parameter of
1, resembles a standard Normal distribution, except that the Cauchy
distribution has less mass at the center but heavier tails (Liang et al.,
2008; Rouder et al., 2009). The argument prior_scale specifies the
width of the Cauchy prior, which corresponds to half of the interquartile
range. Thus, by adjusting the Cauchy prior scale with prior_scale,
different ranges of expected effect sizes can be emphasized. The default
prior scale is set to r = 1 / sqrt(2).
infer_bf creates an S4 object of class
'>baymedrNonInferiority, which has multiple slots/entries (e.g.,
type of data, prior scale, Bayes factor, etc.; see Value). If it is desired
to store or extract solely the Bayes factor, the user can do this with
get_bf, by setting the S4 object as an argument (see Examples).