I am using texreg
to show regressions side-by-side, including SUR systems with systemfit
, but I have some formatting constraints/preferences. I would like to be able to round the coefficients one way, while rounding the goodness-of-fit measures to more digits. For now at least I will also be displaying confidence intervals instead of standard errors, so those are not necessarily a factor here. I also need to output this in HTML and not LaTeX format.
My issue is similar to emagar's How to show only coefficients rounded to whole numbers in LaTeX tables?, but the answer there was largely based around LaTeX tables, while I currently need to be using HTML tables, so the answer to that question, for this and other reasons, is not sufficiently applicable to my issue.
The actual function I am using to do this is actually knitreg
(since this is in R Markdown), but have generally been treating it as htmlreg
.
texreg::knitreg(
l=list(ln(...), systemfit_object),
<various formatting>,
digits=?
)
I suspect that there are several potential work-arounds, and I have already done some complex in this project for other purposes. Obviously, though, I would prefer something simpler, if possible, but really my main preference would be to able to use primarily R
-based code for this.
If you're happy using my huxtable package, this is very simple:
Huxtable tables will automatically print to the right format in knitr documents, so you can just evaluate the object.
An alternative is to use pipe style:
Incidentally, if you like the texreg output style, then you can use
huxtablereg
in that package, then setnumber_format
as above.