2
$\begingroup$

I am trying to construct a mixed effects model and to include in it a measure of the (genetic) distance between observations, so that closer observation from different main effect levels will outweigh distant observations from different main effect levels.
I have constructed a similarity matrix for this purpose but the question now is how to incorporate it (or a transformation of it) in the model. From my understanding of the lmer function in R, random effects can only be a data frame column not a matrix.

Any ideas how to get that incorporated?

$\endgroup$
1

1 Answer 1

1
$\begingroup$

Two ways are apparently possible: Function MCMCglmm() in package MCMCglmm accepts both a (var-covar) matrix as well as a phylogenetic tree as an argument and function lmekin() in package coxme also accepts a var-covar matrix.

$\endgroup$
2
  • $\begingroup$ I find MCMCglmm can be difficult to program. The package "regress" in R provides a simpler way of including a covariance matrix into mixed effects models. $\endgroup$
    – Sarah
    Commented Jun 4, 2013 at 16:27
  • $\begingroup$ right but 'MCMCglmm' is very fast and also allows to directly input a tree. $\endgroup$
    – Roey Angel
    Commented Jun 5, 2013 at 8:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.