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
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
incidence matrices relating the fixed and random effects (b and a)
with the observations y. Furthermore, e is the error term,
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
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
given zero information that we can use to help you with
Please provide a representation of your model and a description of
your data. Or better yet, some sample data. I don't have
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
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
using several random effects (e.g. individual (animal) and
effects). Also, I would like to infer the additive and dominance
relationship matrices (covariance matrices). The function
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