Reputation: 11
I want to test fixed and random effects with the lmerTest R-package. After defining the model with lmer(), I use summary() to get the results. For my results report, I would like to display more decimals of AIC and BIC, of Variance and Std.Dev in Random Effects, of the Estimate and Std.Error (see picture: my output summary(lmer) with missing/few decimals ).
Things I have already tried out that do not help:
options(digits=3)
summary(lmer, digits=3)
coef(summary(lmer), digits=3)
round(summary(lmer), digits=3)
round(coef(summary(lmer)), digits=3)
Upvotes: 1
Views: 730
Reputation: 226627
At present it's not possible to adjust the digit setting for the printing of AIC etc.. You can hack this a bit by using the internal function:
lme4:::.prt.aictab(summary(model)$AICtab, digits = 10)
AIC BIC logLik deviance df.resid
1763.9393445 1783.0970856 -875.9696722 1751.9393445 174
The global digits
option should affect the printing of coef(summary(.))
:
options(digits = 10)
coef(summary(model))
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 251.40510485 6.632122742 18.00113477 37.907185169 1.263751938e-18
and of the random effects variances:
VarCorr(model)
Groups Name Std.Dev. Corr
Subject (Intercept) 23.7797596
Days 5.7167985 0.081321
Residual 25.5919070
For extracting components of a mixed model, also see this question and the glance()
and tidy()
functions from the broom.mixed
package.
Upvotes: 1
Reputation: 100
One way to accomplish this is to load the jtools
package and use options( "jtools-digits" = 3 )
. When calling your model results, use the summ
function to view them.
Upvotes: 1