-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmp_R2 for crossed random effect models? #9
Comments
Thanks, that is a good point. It is true that |
Hi, I'm back. I've spent a lot more time on this stuff recently and have some questions and a fairly large number of comments. (You may notice that I forked the repo (here, primarily to work on Many of my questions are here (markdown file on forked repo). The bottom line: I am working with moderately complex mixed models (three different [partially crossed] random effects with 1-4 terms each, about 10 fixed effects, ~ 700 observations, fitted with Here are the results for lme4 and gamm4 models of the same basic structure (the gamm4 models also include a spatial autocorrelation term; I tried them both because the gamm4 r2 method is an ugly hack that I didn't entirely trust, computing the K-R values one at a time by brute-force fitting the reduced model and comparing). In particular, for the 'kr' values, the R^2 values have extremely wide CIs, and for mammals [purple/squares], the model R^2 is actually less than the largest partial R^2. I know the 'sgv' values are in some sense wrong (because they are picking the number of clusters somewhat arbitrarily from the last-ordered random effect grouping variable), so I feel like 'kr' would be preferable if it weren't somewhat odd. I had some thoughts (follow the link to the questions if you're interested) about a "better" implementation of the SGV approach, but (1) I've already tried lots of factorial combinations of different things and wanted to post this without making it longer and more complicated, and (2) it was my impression that the K-R approach would generally be best, if applicable ... ? (it seems to be recommend by Jaeger et al 2017 ...) I understand completely how hard it is derive sensible R^2 values for complex mixed models, and would be willing to write this off as "well, R^2s are weird sometimes", but would be comforted if you had any thoughts/wisdom to impart ... |
This was very clear and easy to get caught up on. Thank you! I have also encountered situations where Regarding your repo with questions, I realized that I never went back and updated the references in Regarding a longer conversation, that sounds like a great idea to me. Can we initiate some e-mails and then schedule a zoom call? You can reach me at [email protected] |
cmp_R2 has the signature
cmp_R2(c=C, x=X, SigHat=SigHat, beta=beta, obsperclust = obsperclust, nclusts = nclusts, method = 'sgv')
. I'm trying to apply it to a crossed random effects model fitted withgamm4
(I'm extracting the$mer
component of the fitted model, so it's amerMod
object).I understand how to get the contrasts matrix; I'm getting
SigHat
with the utility function below (extracted from the body ofr2beta.lmerMod
). I'm a little confused byobsperclust
,nclusts
, which would only seem to be unambiguously defined for a model with a single grouping variable.I know I can go look at the papers to try to figure it out (and I will), but was hoping for a hint/some guidance ...
The text was updated successfully, but these errors were encountered: