0

I'm trying to find out how well my mixed model with family effect fits the data. Is it possible to extract r squared values from lmekin functions? And if so, is it possible to extract partial r squared values for each of the covariables? Example:

model= lmekin(formula = height ~ score + sex + age + (1 | IID), data = phenotype_df, varlist = kinship_matrix)

I have tried the MuMin package but it doesn't seem to work with lmekin models. Thanks.

b82mo
  • 3
  • 2

1 Answers1

0

I am able to use the r.squaredLR() function,

library(coxme)
library(MuMIn)
data(ergoStool, package="nlme")  # use a data set from nlme 
fit1 <- lmekin(effort ~ Type + (1|Subject), data=ergoStool)
r.squaredLR(fit1)

(I am pretty sure that works, but one thing that is great to do is to create a reproducible example so I can run your code to double check, for example I am not exactly sure what phenotype_df looks like, and I am not able to run your code as it is, a great resource for this is the reprex package).

Lucy
  • 981
  • 7
  • 15
  • 1
    Lucy - that is perfect! Sorry for the lack of reproducible example. I'll definitely check the reprex package. In my particular case I'm not so much interested in partial r squared for each covariate as I am interested in seeing how much a genetic variable improves the model - I think the best way to do this will be to run r.squaredLR(fit1) before and after adding the genetic variable. – b82mo Oct 27 '17 at 11:56