4

I have a negative binomial mixed model with counties nested within states. I've read that the formula for the ICC for a negative binomial model is:

enter image description here
found here: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3916583/

When I run VarCorr(m10), on my random intercept model, I get:
Groups Name Std.Dev. state (Intercept) 0.22709

Could someone explain how to extract the other information from my glmer() model so that I can write a function to compute the ICC? e.g., fixef(m10) gets me the intercept term.

timothy.s.lau
  • 1,113
  • 3
  • 14
  • 28
  • It seems that in your model you did not estimate several of the terms that are referenced in the ICC equation. The equation refers to several different variance components but you only have a single random intercept term. – Jake Westfall Sep 01 '15 at 21:48

1 Answers1

2

This is my functional code (using glmer.nb()):

ICC.NB <- function(model){
  sigma_a2 <- as.numeric(exp(data.frame(VarCorr(model))["vcov"]))
  beta <- as.numeric(fixef(model)["(Intercept)"])
  r <- getME(model,"glmer.nb.theta")
  icc <- (exp(sigma_a2) - 1) / ((exp(sigma_a2) - 1) + ((exp(sigma_a2) - 1) / r) + (exp(-beta - (sigma_a2 / 2))))
  icc
}
ICC.NB(model = m12)
timothy.s.lau
  • 1,113
  • 3
  • 14
  • 28