In this article we consider tests of variance components using Bayes factors. Such tests arise in many fields of application including medicine, agriculture and engineering. When using Bayes factors the choice of prior distribution on the parameter of interest is of great importance and we propose a "unit-information" reference method for variance component models. The calculation of Bayes factors in this context is not straightforward; there are well-documented difficulties with Markov chain Monte Carlo approaches such as Gibbs sampling, and the usual Laplace approximation is not appropriate due to the boundary null hypothesis. We describe both an importance sampling approach and an analytical approximation for calculating the numerator and denominator of the Bayes factor. The importance sampling proposal also forms the basis for a rejection algorithm which allows samples to be generated from the posterior distributions under the null and alternative hypotheses. We show that our importance sampling estimator has finite variance by exploiting a property of the rejection algorithm. Both the importance sampling and rejection method are straightforward to implement.
For large samples we develop a boundary Laplace approximation which is accurate to O(1) in probability, and investigate its accuracy via simulation. The relationship of this approximation to the Schwarz criterion is then examined. We illustrate the importance sampling/rejection method and boundary Laplace approximation on a number of examples including a challenging two-way, highly unbalanced dataset, and compare our conclusions with those from classical approaches.