Created
June 3, 2016 07:20
-
-
Save puterleat/e510770a1309dda044650be34b637ada to your computer and use it in GitHub Desktop.
Function to calculate ICC for lmer model object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# calculate ICC for lmer model object | |
icc <- function(m){ | |
vc <- as.data.frame((VarCorr(m))) | |
l <- vc$vcov | |
data_frame(grp=vc$grp, icc=sapply(l, function(x){x/sum(l)})) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment