incorporate pedigree into lmer
Sorry that I haven't been part of this conversation until now. We had
a weather-related telephone failure in our city that knocked out voice
and Internet communications to our home for a few days. I have only
been able to respond to email from the office and what with meetings,
classes, etc. I have fallen behind.
The questions that Jon is asking relate to the particular form of
random effects models that animal scientists use taking into account
the pedigree of the animals. These are an example of a model with
"carry-over" in the random effects. The random effect for an animal
enters into the model for that animal's responses and for all of that
animal's progeny's responses.
The current form of lmer does not allow for such carry-over. The
models that can be fit are restricted to what might be called
contemporaneous random effects. In particular, only one level of a
grouping factor can be involved in the model for a given response.
That's the bad news. The good news is that there is nothing in the
computational methods that precludes carry-over in the model. It is
"simply" a matter of modifying the model matrix for the random effects
before creating the mer objects. The pedigree class was defined
exactly for this purpose. If you look at
example("pedigree-class")
you will see that there are methods for creating the matrices to be
used for the transformation but that work is not complete.
On 2/6/07, Doran, Harold <HDoran at air.org> wrote:
It's good to keep this on list for others to chime in and for reference. You need the ranef extractor ranef(fm1)$sire
-----Original Message----- From: Jon Hallander [mailto:Jon.Hallander at genfys.slu.se] Sent: Tuesday, February 06, 2007 10:41 AM To: Doran, Harold Subject: RE: [R-sig-ME] incorporate pedigree into lmer Ok, thanks! This seems to work, but does it utilize the pedigree information? When I type the command summary(fm1) I do not get individual random effect values (breeding values), but variances of the random effects:
fm1 <- lmer(y ~ 1 +(1|sire) + (1|dam), data) summary(fm1)
Linear mixed-effects model fit by REML
Formula: y ~ 1 + (1 | sire) + (1 | dam)
Data: data1
AIC BIC logLik MLdeviance REMLdeviance
28.24 27.62 -11.12 23.45 22.24
Random effects:
Groups Name Variance Std.Dev.
sire (Intercept) 1.75e-09 4.1833e-05
dam (Intercept) 1.75e-09 4.1833e-05
Residual 3.50e+00 1.8708e+00
number of obs: 6, groups: sire, 4; dam, 3
Fixed effects:
Estimate Std. Error t value
(Intercept) 3.5000 0.7638 4.583
/Jon
-----Original Message-----
From: Doran, Harold [mailto:HDoran at air.org]
Sent: den 6 februari 2007 15:03
To: Jon Hallander; r-sig-mixed-models at r-project.org
Subject: RE: [R-sig-ME] incorporate pedigree into lmer
Well, I'm still guessing at what you want as a fixed effect
and what will be random, but here is a shot
(fm1 <- lmer(weight ~ 1 +(1|Sire) + (1|Dam), data))
-----Original Message----- From: Jon Hallander [mailto:Jon.Hallander at genfys.slu.se] Sent: Tuesday, February 06, 2007 8:26 AM To: Doran, Harold; r-sig-mixed-models at r-project.org Subject: RE: [R-sig-ME] incorporate pedigree into lmer Oh, sorry for being unclear. I am using a mixed linear
model including
both random and fixed effects: y = Xb + Za + e where the vector y are observed individual data, b is a vector of fixed effects, a is an individual additive random effect that are normally distributed vectors with (co)variance A*var(a). X
and Z are
incidence matrices relating the fixed and random effects (b and a) with the observations y. Furthermore, e is the error term,
w normally
distributed with mean zero and variance var(e). A is the additive genetic relationship matrix which is computed using the pedigree information (given below). A typical data might look like this: Id Sire Dam y (i.e. weight in kg) 1 Na Na 4.3 2 Na Na 4.7 3 1 2 4.4 4 1 Na 4.1 5 4 2 4.3 6 4 2 4.2 Thanks for the help. Best regards, Jon -----Original Message----- From: r-sig-mixed-models-bounces at r-project.org [mailto:r-sig-mixed-models-bounces at r-project.org] On Behalf
Of Doran,
Harold Sent: den 6 februari 2007 13:51 To: Jon Hallander; r-sig-mixed-models at r-project.org Subject: Re: [R-sig-ME] incorporate pedigree into lmer Jon I think you will find the members of this list helpful, but
you have
given zero information that we can use to help you with
your problem.
Please provide a representation of your model and a description of your data. Or better yet, some sample data. I don't have
any idea what
an "animal model" is (maybe others do), but if you can provide a statistical representation, maybe we can walk you through this. Harold
-----Original Message----- From: r-sig-mixed-models-bounces at r-project.org [mailto:r-sig-mixed-models-bounces at r-project.org] On
Behalf Of Jon
Hallander Sent: Tuesday, February 06, 2007 7:07 AM To: r-sig-mixed-models at r-project.org Subject: [R-sig-ME] incorporate pedigree into lmer Hello, I am a novice using the lme4 library and would like some help regarding the function lmer. I would like to solve the
animal model
using several random effects (e.g. individual (animal) and
dominance
effects). Also, I would like to infer the additive and dominance relationship matrices (covariance matrices). The function
pedigree can
set up the pedigree structure, but how do I use it in the lmer function? I have not found any convenient example. Thanks in advance. Best regards, Jon Hallander
____________________________________________ Jon Hallander Department of Forest Genetics and Plant Physiology Swedish
University
of Agricultural Sciences SE-901 83 UME? SWEDEN Phone: +46 90 786 82 80 Mobile: +46 70 220 08 79 Fax: +46 90 786 81 65 E-mail: jon.hallander at genfys.slu.se
____________________________________________
###########################################
This message has been scanned by F-Secure Anti-Virus for
Mic...{{dropped}}
_______________________________________________
R-sig-mixed-models at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models ########################################### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. For more information, connect to http://www.f-secure.com/
########################################### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. For more information, connect to http://www.f-secure.com/
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models