Last active
February 15, 2017 00:07
-
-
Save stonegold546/78ed31b40522cdf1cb9a49cbad7382cd to your computer and use it in GitHub Desktop.
R code for Full maximum likelihood calculation of ICC
This file contains 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
# require(lme4) | |
mymod <- function(data) { | |
result <- lme4::lmer(y ~ 1 + (1 | x), data = data, REML = FALSE) | |
sumy <- summary(result) | |
varb <- sumy$varcor$x[1] | |
varw <- sumy$sigma ^ 2 | |
icc <- varb / (varb + varw) | |
c(icc, varb, varw) | |
} | |
# mymod(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment