[R-sig-ME] How to specify user-defined matrix Z?

Crump, Ron R.E.Crump at warwick.ac.uk
Fri Sep 29 12:28:18 CEST 2017

Hi Zhengyang,

> In genetic studies, we sometimes include the genetic relatedness matrix as a variance component, so we have this following model:
> Y~Xbeta+Zb+error,
> where beta are the fixed effects, b~N(0,sigma^2*I) are the random effects, error are the random error, Z is the cholesky decomposition of the known genetic relatedness matrix. So how to use lme4 to fit this model if we know X and Z beforehand? I can use the package "nlme" to do it using the code like
> lme(y~-1+X, random=list(group=pdIdent(~-1+Z))),
> but how to do it using lme4?

I think, assuming you are using I to indicate an identity matrix, that
in neither case are you specifying a genetic relationship matrix, unless 
you are somehow incorporating it into Z (in which case I'd like to see how).

I don't believe that either lme4 or nlme will allow you to do what you
want. (Somebody might correct me on this).

Within R you could certainly use MCMCglmm or INLA to do analysis of
quantitative genetics data to obtain genetic parameters (or the asremlr
interface to ASREML). I've not used it, but the pedigreemm package also
looks like it would help you and there may be others. Outside of R,
Karin Meyer's wombat program will also do the job.


More information about the R-sig-mixed-models mailing list