R code for pulling out fixed effect standard errors in lme4 package
R code for pulling out fixed effect standard errors in lme4 package
I'd like to pull out the standard error for a regression done using lmer(). For example,
library(lme4)
data(iris)
head(iris)
model <- lmer(Sepal.Length ~ Sepal.Width + (1 | Species), data=iris);
summary(model)
Looking at the fixed effects of the summary, you can see the standard errors.
Fixed effects:
Estimate Std. Error t value
(Intercept) 3.4062 0.6683 5.097
Sepal.Width 0.7972 0.1062 7.506
I'd like to pull this out instead of having to type it in manually.
This question came from our site for people interested in statistics, machine learning, data analysis, data mining, and data visualization.
1 Answer
1
summary(model)$coef[, 2, drop = FALSE]
Or
sqrt(diag(vcov(model)))
+1 but the question is off-topic.
– amoeba
Aug 22 at 21:04
@amoeba I figured I’d respond and we’d migrate it to SO
– Mark White
Aug 22 at 21:07
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Why is this off topic? It's a question about statistical programming.
– Blake Shurtz
Aug 26 at 20:50