Friday, April 1, 2011

R lmer: how to to extract fixed effects with p-values

coeffun = function(fit)
{
  vc <- vcov(fit, useScale = FALSE)
  b <- fixef(fit)
  se <- sqrt(diag(vc))
  z <- b / sqrt(diag(vc))
  P <- 2 * (1 - pnorm(abs(z)))
  return(cbind(b, se, z, P))
}


This assumes normality of estimated coefficients
from https://stat.ethz.ch/pipermail/r-help/2005-December/084015.html

No comments:

Post a Comment

Subscribe via email

Enter your email address:

Delivered by FeedBurner

Followers

google analytics