[R] Accounting for correlated random effects in coxme
Therneau, Terry M., Ph.D.
therneau at mayo.edu
Tue Sep 22 20:09:33 CEST 2015
I've been away for a couple weeks and am now catching up on email.
The issue is that the coxme code does not have conversions built-in for all of the
possible types of sparse matrix. Since it assumes that the variance matrix must be
symmetric, the non-neccarily-symmetric dgCMatrix class is not one that I had considered.
You should transform it to dsCMatrix first, which is a symmetric
class. Or if it is small enough, to a simple matrix.
On 09/22/2015 05:00 AM, r-help-request at r-project.org wrote:
> I have a problem with running the mixed effects Cox regression model using
> a distance matrix from a phylogeny rather than a pedigree. I searched
> previous posts and didn't find any directly relevant previous posts.
> I am interested in using a mixed effects Cox regression model to determine
> the best predictors of time to recruitment in 80 different reintroduced
> plant populations representing a total of 31 species. I will like to
> account for correlated random effects that result from phylogenetic
> relationships amongst species. Dr. Therneau's 2015 article on Mixed Effects
> Cox Models provide a very helpful template for me to do this with the coxme
> function in R. In this article, the correlation structure due to genetic
> relationships amongst individuals was defined using a kinship matrix
> derived from a pedigree. Instead of a pedigree, I have a phylogeny for
> these 31 species. Hence, I used the inverseA function in the MCMCglmm
> package to generate an inverse additive genetic relatedness matrix from the
> phylogeny for these 31 species. And then fed it in as input to the varlist
> argument in my mixed effects cox regression model (using function coxme). I
> got an error message (please see below). Based on the error, one thought I
> had was to convert the inverseA matrix from a ?dgCMatrix? to ?bdsmatrix?
> but this was not successful either. I have also unsuccessfully tried to use
> a pairwise phylogenetic distance matrix.
> Is there a better way to do this? I basically just want to account for the
> correlated random effects due to phylogenetic relatedness amongst the 31
> species represented in the dataset for the Cox regression model. Please
> see my code below and I welcome suggestions on how best to make this work.
More information about the R-help