Created
March 21, 2014 21:35
-
-
Save nickbloom/9697001 to your computer and use it in GitHub Desktop.
Getting xtable to play nicely with lmer output in R
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
library(arm) | |
library(lmer) | |
library(xtable) | |
# This is only for fixed effects, so it's kind of a hacky solution. I'm working (slowly) on an alternative that includes more info. | |
mlm1<-lmer(Your Equation Here) | |
outmat<-cbind(fixed(mlm1), se.fixef(mlm1)) | |
outmat<-cbind(outmat, se <- sqrt(diag(mixed.1$vcov))) | |
outmat<-cbind(outmat, (outmat[,1]/outmat[,2])) | |
outmat<-cbind(outmat, 2*pnorm(-abs(outmat[,3]))) | |
outmat<-round(outmat, 4) | |
# then you can just output using xtable, but you have to name your columns and rows | |
mlm1.out<-xtable(outmat) | |
col.names(mlm1.out)<-c("Coef.", "SE", "t-value", "p") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment