0

I am displaying a multilevel model and would like to show three decimal places when output to screen.

M3 <- lmer(stflife ~ sclmeet + health + wkdcorga + hincfel + fltlnl 
           + rshpsts + dosprt + c_corruption_2014 + c_ticpi_2014  + 
             (1 | cntry), data = countries) 
display(M3)
eipi10
  • 91,525
  • 24
  • 209
  • 285
Syd06
  • 3
  • 4
  • `options(digits=3)` ? May be a duplicate of [Formatting Decimal places in R](https://stackoverflow.com/q/3443687/4752675) – G5W Apr 17 '18 at 21:21
  • I tried but I am not sure I am inserting it well in my code as it shows errors. How should I integrate it in the model above? – Syd06 Apr 17 '18 at 21:25
  • 1
    Just add `options(digits=3)` as a separate statement right before your statement `display(M3)` – G5W Apr 17 '18 at 21:26
  • it is still showing only two without any error – Syd06 Apr 17 '18 at 21:27
  • OH! I though that your problem was that you were showing too many digits. You know without your data, we cannot run your code and see what you see. It does seem unlikely that all coefficients would actually only have two significant digits. – G5W Apr 17 '18 at 21:32
  • So do you have any suggestion for me? – Syd06 Apr 17 '18 at 21:35
  • Sorry, but no. I did not understand your problem and I do not have an answer for it now that you have clarified. – G5W Apr 17 '18 at 21:38

1 Answers1

0

Assuming this is the display function from the arm package, display(M3, digits=3) will display results to three decimal places. The digits argument is documented in the help for display, which can be accessed by running ?display.

eipi10
  • 91,525
  • 24
  • 209
  • 285