Hi everyone,
I have come across some very helpful conversations on the archives for this
list regarding fitting animal models, but I'm afraid I'm still a bit lost!
Jon Hallander gave a good description of the model in "[R-sig-ME]
incorporate pedigree into lmer" discussion Feb 6, 2007, pasted below:
Animal model:
"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, 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" (end of pasted passage).
I would like to estimate the additive variance and error variance (in order
to estimate heritability) and it would also be nice to predict the
"breeding" (additive) values for each individual.
My (simulated) data set "animalmodel.txt" contains information on the animal
id, the generation and the trait value (simulated just as additive effects
plus an error), with 10 offspring from 13 parents all with trait data, along
with a 23x23 relationship matrix linking animals to their parents and sibs
("covmatrix.txt"). There is a constraint at this point as I have a covmatrix
rather than a pedigree so some of the previously suggested methods using
"pedigree" / "kinship" might not work.
Based on previous discussions in this list I tried fitting the following:
1. animaldata<-read.delim("data_animal.txt")
2. covmatrix<-read.table("covmatrix.txt")
3. correlation=corSymm(covmatrix[lower.tri(covmatrix)], fixed=TRUE)
4. correlation1<-Initialize(correlation,data=animaldata)
5.
animalmodel<-lme(trait~generation,random=~1|animal,correlation=correlation1,data=animaldata)
I have a number of problems at this point. First, I am not confident that
the model is right (actually, I imagine I probably should be somehow
including the random effects in the model statement?). Second, I am not sure
the function is correct (perhaps I shouldn't be using lme in the nlme
package? would lmer in lme4 and then VarCorr be better?). Third, I am unsure
how to find the additive variance in the output, and particularly how to
predict breeding values and heritability from here.
I would very much appreciate any guidance!
With many thanks and best wishes,
Anna Santure

	[[alternative HTML version deleted]]


