# R square in mixed model with random effects

For mixed models with random intercepts only, the statistic for R square is

$$R^2 = (V_{int\ only} - V_{full\ model}) / V_{int\ only}$$

My question is: How to estimate R square in mixed models with random effects? And estimate R square for each level? Let's say it's a 3-level model with random effects of time at level 2.

The R package MuMIn also now has a function for calculating Nakagawa and Schielzeth's r-squared for mixed models. That is the function r.squaredGLMM() and you simply feed it a lmer object (from package lme4) to obtain the values. MuMIn has excellent documentation so you should be able to learn any details there.
Nakagawa, S. and Schielzeth, H. (2012). A general and simple method for obtaining $R^2$ from generalized linear mixed-effects models. Methods in Ecology and Evolution, in press. DOI: 10.1111/j.2041-210x.2012.00261.x