The Behrens-Fisher Problem

One of the famous examples in the history of statistics is the Behrens-Fisher problem (Fisher, 1935). Consider the situation where there are two independent samples from two different normal distributions:

Note that . When you do not want to assume that the variances are equal, testing the hypothesis is a difficult problem in the classical statistics framework, because the distribution under is not known. Within the Bayesian framework, this problem is straightforward because you can estimate the posterior distribution
of while taking into account the uncertainties in all of parameters by treating them as random variables.

The response variable is y, and the ind variable is the group indicator, which takes two values: 1 and 2. There are 19 observations that belong to group 1 and 14
that belong to group 2.

The likelihood functions for the two samples are as follows:

Berger (1985) showed that a uniform prior on the support of the location parameter is a noninformative prior. The distribution is invariant
under location transformations—that is, . You can use this prior for the mean parameters in the model:

In addition, Berger (1985) showed that a prior of the form is noninformative for the scale parameter, and it is invariant under scale transformations (that is ). You can use this prior for the variance parameters in the model:

The log densities of the prior distributions on and are:

The following statements generate posterior samples of , and the difference in the means: :

The PROC MCMC statement specifies an input data set (Behrens), an output data set containing the posterior samples (Postout), a random number seed, and the simulation size. The MONITOR=
option specifies a list of symbols, which can be either parameters or functions of the parameters in the model, for which
inference is to be done. The symbol _parms_ is a shorthand for all model parameters—in this case, mu1, mu2, sig21, and sig22. The symbol mudif is defined in the program as the difference between and .

The ODS SELECT statement displays the summary statistics and interval statistics tables while excluding all other output.
For a complete list of ODS tables that PROC MCMC can produce, see the sections Displayed Output and ODS Table Names.

The PARMS
statements assign the parameters mu1 and mu2 to the same block, and sig21 and sig22 each to their own separate blocks. There are a total of three blocks. The PARMS
statements also assign an initial value to each parameter.

The PRIOR
statements specify prior distributions for the parameters. Because the priors are all nonstandard (uniform on the real axis
for and and for and ), you must use the GENERAL
function here. The argument in the GENERAL
function is an expression for the log of the distribution, up to an additive constant. This distribution can have any functional
form, as long as it is programmable using SAS functions and expressions. The function specifies a distribution on the log
scale, not on the original scale. The log of the prior on mu1 and mu2 is 0, and the log of the priors on sig21 and sig22 are –log(sig21) and –log(sig22) respectively. See the section Specifying a New Distribution for more information about how to specify an arbitrary distribution. The LOWER= option indicates that both variance terms
must be strictly positive.

The MUDIF assignment statement calculates the difference between mu1 and mu2. The IF-ELSE statements enable different y’s to have different mean and variance, depending on their group indicator ind. The MODEL
statement specifies the normal likelihood function for each observation in the model.

The mean difference has a posterior mean value of 13.37, and the lower endpoints of the 99% credible intervals are negative.
This suggests that the mean difference is positive with a high probability. However, if you want to estimate the probability
that , you can do so as follows.

The sample estimate of the posterior probability that is 0.98. This example illustrates an advantage of Bayesian analysis. You are not limited to making inferences based on model
parameters only. You can accurately quantify uncertainties with respect to any function of the parameters, and this allows
for flexibility and easy interpretations in answering many scientific questions.