[R-sig-ME] LMM covariance structure
bates at stat.wisc.edu
Sun Mar 8 17:32:07 CET 2009
On Sat, Mar 7, 2009 at 10:14 AM, Pietro Ravani <pravani at ucalgary.ca> wrote:
> Dear Doug
> I sent my reply twice (* copied below) but I cannot see it
> Can you pls check?
The first copy was sent to me only and the second copy was held for
list moderator's approval because you are not enrolled on the mailing
list or not at the same email address from which you posted. To cut
down on spam we restrict postings to those email addresses that are
Many people send questions or replies to me personally and I try to
forward them to the mailing list, asking permission before I do so, so
that others can provide answers or follow-up questions and so that
there is an archival record. I enjoy corresponding with people about
these questions but I don't always have the time to do so and, quite
frankly, personalized tutoring is not the best use of my time. My
long-suffering editor would prefer that I spend my time writing a book
manuscript so that many people can learn about such models and how to
use the lme4 package simultaneously and I do agree that it would be a
more efficient approach.
> Yes, I was referring to the conditional variance-covariance structure
> of the response given the random effects, which is referred to as R in
> the book of West, Welch, Galecki that I found mathematically
> affordable (I am studying the R language now, and trying to learn more
> about correlated data for study design purposes).
It would have helped to state that rather than assuming that everyone
uses the notation and terminology from that particular book. There
are many different ways or writing mixed-effects models.
> And yes, I meant "non-zero", as stated in the erratum.
> Looking at the output of the getVarCov() function in R, I see that
> choosing "conditional" as "type" I obtain a matrix with the estimate
> of the error "variance" on the diagonal (which can be heterogeneous,
> i.e. vary within cluster/group by values of cluster level co-variates)
> and all "zeros" off the diagonal. I thought this is what LMM do:
> explaining the group heterogeneity in the data (and the resulting
> correlation in the responses) through splitting the random portion of
> the statistical model into two layers, the random effects and the
> random errors. These random errors - conditioning on the random
> effects - I thought were normally distributed with zero mean and some
> variance sigma2 (on the diagonal of the R matrix) and independent
> (thus with zero co-variances off the diagonal of the R matrix).
> Typing "marginal" in the above cmd tells R to give me what I thought
> it was the combination (marginal model implied by the LMM) of the 2
> VCV matrices, D (matrix of the random effects parameters) and R
> (matrix of the random error parameter). The fact that different
> structures (of the R matrix?) - mentioned in the previous emails
> (compound symmetry, AR 1, Toeplitz, etc) - can be specified in the
> lme() function via the correlation argument confuses me, unless they
> refer to the resulting marginal model matrix (not the R matrix
> conditional on the random effects). I have the impression I am lost
> (although I know I have much more to learn).
As explained in the posting guide for the R-help mailing list,
providing a small self-contained example will often lead to more
productive responses. A clearly stated question, including such items
as which package you have attached, is easier to answer.
Reading between the lines and given the information that you are
adopting the terminology of the West, Welch and Galeki book I imagine
that you are viewing the nlme package the lme function for fitting
linear mixed effects models as "R". R is a language and environment.
Base R includes several functions and a set of required packages. As
far as I know the only function there that can fit mixed-effects
models is anova and that can only be applied to certain balanced
designs. There are now several thousand contributed packages in R,
many of which provide functions to fit mixed-effects models. The nlme
package is one, the lme4 package is another. Most discussions on this
mailing list are related to the lme4 package and the lmer function but
we do also discuss nlme and lme (and you did mention that you were
using lme() so we can pick that up).
I really don't remember what getVarCov returns in complex cases and I
don't want to drop everything to go back and figure it out.
> Directions re math friendly sources / learning tools (especially using
> R) would be very appreciated of course
Well, Jose Pinheiro and I did write a book "Mixed-effects Models in S
and S-PLUS" (Springer, 2000) that does cover the mathematical theory
as well as the computational details. I'm not sure what "math
friendly" means so I can't judge whether it fits that description.
> [[alternative HTML version deleted]]
> R-sig-mixed-models at r-project.org mailing list
More information about the R-sig-mixed-models