-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pander.lm() and pander.summary.lm(): Reordering of coefficients #232
Comments
Good catch, thanks for reporting this issue! The above (very trivial, but hopefully OK) commit should resolve this behavior -- looking forward to any feedback. |
Thanks. I'd prefer not to rearrange parameters at all (or at least make it optional), but you probably have a good reason to do this the way you're doing it. |
@RomanTsegelskyi do you remember the motives behind moving the intercept to the bottom of the table? |
I can't recall the reason right away, so it might be my mistake when I was refactoring the implementation |
I spent some time digging the git history and found d28cf55 to be the related commit. This is due to #46, and we are moving the intercept to the bottom of the table as this looked appropriate based on the @krlmlr @kovla does it make sense? Not sure if it's needed or not (personally, I do not care if the intercept is on the top or at the bottom of the table), looking forward to any feedback. And of course we can make this optional. |
IMO, if some journals require this behavior, it's reasonable to support it as an option. Making it default confuses newbies that are used to R's output. |
Makes sense, done with the above commit: > pander(lm(am ~ wt, mtcars))
--------------------------------------------------------------
Estimate Std. Error t value Pr(>|t|)
----------------- ---------- ------------ --------- ----------
**(Intercept)** 1.542 0.2256 6.838 1.378e-07
**wt** -0.3532 0.06717 -5.258 1.125e-05
--------------------------------------------------------------
Table: Fitting linear model: am ~ wt
> pander(lm(am ~ wt, mtcars), move.intercept = TRUE)
--------------------------------------------------------------
Estimate Std. Error t value Pr(>|t|)
----------------- ---------- ------------ --------- ----------
**wt** -0.3532 0.06717 -5.258 1.125e-05
**(Intercept)** 1.542 0.2256 6.838 1.378e-07
--------------------------------------------------------------
Table: Fitting linear model: am ~ wt |
The coefficient that appears first in the output of
summary.lm()
seems to appear last in the output ofpander::pander.lm()
. It looks like this is by design, but this makes models without intercept look very awkward.The text was updated successfully, but these errors were encountered: