# Edps 589 # Spring 2019 # c.j.anderson # # This is a little function that I wrote to compute # The icc (or residual) icc from a 2 level model # # To use it, run function through R and then # icc.lmer(name.of.model) # icc.lmer <- function(modl) { vars <- as.data.frame(VarCorr(modl))[4] total <- sum(vars) tau00 <- vars[1,1] icc <- tau00/total return(icc) }