Thanks for the clarification, Doug.

I asked a colleague about this the other day, and she indicated that it is possible to use numerical integration for multiple random effects in Stata . . . but she wasn't sure if that would apply to cross-classified models or perhaps just hierarchically nested random effects.

On a related note, I'd be interested in using MCMC estimation, and I remember reading a while ago that you were thinking about integrating that option in lme4.  Since then, I've seen some evidence that there's an mcmcsamp option, but I haven't been able to find any representative scripts so far.  Do you know of any examples that would be good to follow?

Thanks again.

--- On Mon, 10/25/10, Douglas Bates <bates@stat.wisc.edu> wrote:

From: Douglas Bates <bates@stat.wisc.edu>
Subject: Re: [R-sig-ME] Numerical integration for cross-classified random effects in lme4
To: "Jeremy Koster" <helixed2@yahoo.com>
Cc: r-sig-mixed-models@r-project.org
Date: Monday, October 25, 2010, 2:49 PM

On Sun, Oct 24, 2010 at 6:46 PM, Jeremy Koster <helixed2@yahoo.com> wrote:
> Hi folks,
>
> This has likely been asked before, so please feel free to link any relevant posts . . .
>
> I am looking at a network of 300+ households.  The outcome variable is dichotomous -- i.e., does Household A share food with Household B?  Because food can flow both ways, one row in the dataset is for Household A to Household B, and then there's another row for B to A.  So I'd like to add a random effect for the dyad (DyadID).  In addition, some households just generally give more, and others generally receive more, so I'd like to add random effects for donating households (GNO) and receiving households (RNO).
>
> My impression was that it's possible to fit cross-classified random effects using numerical integration in lme4.  However, when I try to fit an empty model using this code:
>
> model.empty <- glmer (Sharing ~ 1 + (1|DyadID) + (1|GNO) + (1|RNO),family = binomial, nAGQ=10)
>
> Then I get the following error message:
>
> Error in validObject(.Object) :
>   invalid class "mer" object: AGQ method requires a single grouping factor

As the message indicates, adaptive Gauss-Hermite quadrature is only
available for models with random effects defined with respect to a
single grouping factor.

When there is only one grouping factor the observations can be split
according to the levels of the grouping factor and the integral
defining the likelihood of the parameters can be expressed as the
product of a number of low-dimensional integrals.  You need low
dimensional, preferably one-dimensional, integrals before you can hope
to apply AGQ.  For high-dimensional integrals that number of
evaluations of the conditional mean that would be required for a
single evaluation of the likelihood of the parameters would be
prohibitive.

The Laplace approximation, which does require optimization of the
unscaled conditional density, but only requires evaluation of the
conditional mean at that point, is feasible for models with crossed
random effects.



      
	[[alternative HTML version deleted]]


