Skip to content

Instantly share code, notes, and snippets.

@smithdanielle
Created March 31, 2015 20:43
Show Gist options
  • Save smithdanielle/03efd281bd277488d742 to your computer and use it in GitHub Desktop.
Save smithdanielle/03efd281bd277488d742 to your computer and use it in GitHub Desktop.
Get standardised regression coefficients from a LMER object in R
lm.beta.lmer <- function(mod) {
b <- fixef(mod)[-1]
sd.x <- apply(getME(mod,"X")[,-1],2,sd)
sd.y <- sd(getME(mod,"y"))
b*sd.x/sd.y
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment