A deviance test (or likelihood ratio test) can be performed to compare two nested models. However, the deviance statistic that this test is based on, can be calculated using ML (maximum likelihood) or REML (restricted maximum likelihood) estimation. All the texts I have read seem to agree that if the nested models differ in terms of fixed effects, ML should be used. However,
 I am confused what I should do if the nested models differ in terms of random or variance parameters (a random effect, or heterogeneity of variance at level 1). I am pretty sure that I have read on several occasions that REML should be used when performing a deviance test for random parameters. However, the second edition of the Snijders & Bosker book (2012, 'Multilevel analysis') seems to suggest that both ML and REML-based deviance can be used in the deviance test for random parameters.
 So my conclusion would be that for a deviance test involving random parameters both are fine (equally so?), but for fixed parameters only ML can be used. Does anyone know the answer?