On Mon, 31 May 2010, Albart Coster wrote:
I am working with genetic data and puzzling with the following problem. An individual inherits one allele from each of his parents and both alleles contribute an unknown quantity to its phenotype. If we want to model his phenotype, we can write it as P = a0 + a1. Now, imagine that we have 3 alleles, numbered 1, 2, and 3. Then, we can have the following individuals: if the order of the alleles does not matter. Now, I would like to fit this in a model where the effect of the alleles is random and with a single variance term for all the alleles. The problem is that each individual can have 0, 1, or 2 copies of each allele while in the normal (Z) matrix of a mixed model we can only have 0's and 1's.
No, they can take any value, and this would be one approach to your setup.
Fitting it as follows in lme4 will not give the correct solutions: lmer(P~1 + (1|a0) + (1|a1),data = df)
If you were fitting a genotypic model, you would have P ~ (1|g), where g is a factor with six levels or six binary indicator variables. If there were parent of origin effects, then your model as stated would be appropriate. For the model under exchangability, you need three indicator variables representing the count of each allele type for each individual (just the same as in the fixed effects type model). Cheers, David Duffy.
| David Duffy (MBBS PhD) ,-_|\ | email: davidD at qimr.edu.au ph: INT+61+7+3362-0217 fax: -0101 / * | Epidemiology Unit, Queensland Institute of Medical Research \_,-._/ | 300 Herston Rd, Brisbane, Queensland 4029, Australia GPG 4D0B994A v