Skip to content

Specifying fixed residual variances for multilevel models

3 messages · Zaslavsky, Alan M., Vincent Dorie, Viechtbauer Wolfgang (STAT)

#
We have a bunch of analyses in which we would like to specify residual variances that are calculated outside the multilevel modeling function.  We were proceeding on the assumption that using varFixed() for the weights argument to lme() would do this, but after doing a few simulations it became evident that this was only fixing the residual variances up to a proportionality constant and in fact rescaling the weights had no effect on estimates of random effects variances.  

I've spent a few hours scanning the documentation, list comments and FAQs without tracking down a solution.  This seems to be more a feature than a bug, although comments I see on this list and Github, among other places suggest that the handling of residual variances or weights is the subject of current development efforts (lme4a?).  Not surprising --- in fact the terms 'weights' has at least as many meanings as 'fixed effects', with potentially different analytic implications (especially for mixed models).  I would urge talking explicitly about residual variance models, which have a clear interpretation.

Any thoughts?  

                Alan Zaslavsky
                zaslavsk at hcp.med.harvard.edu

NLME EXAMPLE
Linear mixed-effects model fit by REML
  Data: NULL 
  Log-restricted-likelihood: -696.8343
  Fixed: y ~ 1 
(Intercept) 
  0.3656883 
Random effects:
 Formula: ~1 | group
        (Intercept) Residual
StdDev:   0.9231727 1.257827
Number of Observations: 400
Number of Groups: 40
Linear mixed-effects model fit by REML
  Data: NULL 
  Log-restricted-likelihood: -692.0942
  Fixed: y ~ 1 
(Intercept) 
  0.3513349 
Random effects:
 Formula: ~1 | group
        (Intercept) Residual
StdDev:   0.9261319 1.021891
Variance function:
 Structure: fixed weights
 Formula: ~V 
Number of Observations: 400
Number of Groups: 40 
##  the one above specified the residual variances that were used in generating the
##  the data and there estimated scale factor close to 1, as it should
Linear mixed-effects model fit by REML
  Data: NULL 
  Log-restricted-likelihood: -692.0942
  Fixed: y ~ 1 
(Intercept) 
  0.3513349 
Random effects:
 Formula: ~1 | group
        (Intercept)  Residual
StdDev:   0.9261319 0.5899889
Variance function:
 Structure: fixed weights
 Formula: ~V2 
Number of Observations: 400
Number of Groups: 40 
###  here we increased the specified residual variance by a factor of 3, but it was ignored except that the residual scale factor went down by a factor of sqrt(3) as shown below.  All very good if you only know *relative* residual variances but not helpful if you know them *absolutely*
[1] 3.000001

LMER (same data)
Linear mixed model fit by REML ['lmerMod']
Formula: y ~ 1 + (1 | group) 
REML criterion at convergence: 1570.624 
Random effects:
 Groups   Name        Std.Dev.
 group    (Intercept) 0.7569  
 Residual             1.2824  
Number of obs: 400, groups: group, 40
Fixed Effects:
(Intercept)  
     0.3788
Linear mixed model fit by REML ['lmerMod']
Formula: y ~ 1 + (1 | group) 
REML criterion at convergence: 2010.069 
Random effects:
 Groups   Name        Std.Dev.
 group    (Intercept) 0.437   
 Residual             1.282   
Number of obs: 400, groups: group, 40
Fixed Effects:
(Intercept)  
     0.3788  
############  even stranger -- rescaling residual variance leaves residual var estimate alone, but changes level-2 variance by factor of 3
[1] 2.999951
1 day later
#
I'm not familiar with how lme works, but if the lmer formulation is sufficient then you can fit models of that sort using blmer in the blme package. Simply fix the common residual variance to one and supply the weights, at which point they'll behave as desired.

For example,

library(blme)
blmer(formula = y ~ 1 + (1 | group), weights = V,
      resid.prior = point(1.0), cov.prior = NULL)

Vince
On Feb 22, 2014, at 6:02 PM, Zaslavsky, Alan M. wrote:

            
1 day later
#
In meta-analytic models, we commonly fix the residual variances to (at least approximately) known values. Following your example, you could fit the desired models with the 'metafor' package with:

library(metafor)

rma.mv(y, V, random = ~ 1 | group)
rma.mv(y, V2, random = ~ 1 | group)

This will really fix those residual variances to V and V2 (not just up to that proportionality constant).

At the moment, rma.mv() isn't optimized for speed, so it takes a bit to get the model to converge. The next version of metafor (to be released in the near future) will be faster.

Best,
Wolfgang

--   
Wolfgang Viechtbauer, Ph.D., Statistician   
Department of Psychiatry and Psychology   
School for Mental Health and Neuroscience   
Faculty of Health, Medicine, and Life Sciences   
Maastricht University, P.O. Box 616 (VIJV1)   
6200 MD Maastricht, The Netherlands   
+31 (43) 388-4170 | http://www.wvbauer.com