This question already has an answer here:
I ran linear mixed effects model in R.
model<-lmer(yld ~ rain + (1+rain|state),data=data,REML=FALSE)
Is there any way I can generate an R-squared for the model. I know we can derive R-squared for a generalised linear mixed effects model http://jonlefcheck.net/2013/03/13/r2-for-linear-mixed-effects-models/ but I am not sure about a linear mixed effect model. Can anyone point me to the right direction/webpages/code?
Thanks a lot
Unfortunately, I cannot answer a question marked as duplicate and as I'm new here I cannot comment on questions due to my low reputation. But I can edit other peoples questions???
You may want to have a look at Nakagawa & Schielzeth (2013) A general and simple method for obtaining R 2 from generalized linear mixed-effects models. Methods in Ecology and Evolution 2013, 4, 133–142. doi: 10.1111/j.2041-210x.2012.00261.x Within the supplementary information of the online article they provide such an example. However, note that I had substitute "mF@X" by "model.matrix(mF)" in order to get the code working. Best Philipp