Closed jsr-p closed 1 month ago
Thank you!
Could you also add a test in
tests/testthat/test-lmtest.R
for this case and note the change in NEWS?
Thanks for the code review! I have added a test here, updated the news and moved the fix inside tidy.coeftest.
Thank you for the revisions! I just pushed a few small edits—will merge once checks pass. I appreciate your work here!
@simonpcouch thank you too! 😄
This pull request has been automatically locked. If you believe the issue addressed here persists, please file a new PR (with a reprex: https://reprex.tidyverse.org) and link to this one.
When using tidy with coeftest on a model with a constant terms nan are produced by the confint function. The reason is that the intercept rowname does not pass through. The error is inside the
broom_confint_terms
function. When hitting a breakpoint we can inspect the x input variable to the dataframe. As shown belownames(coef(x))
returns NULL so no rowname will be set and when it is larger merged onto the other variables the nans are produced. This PR checks for a one-dimensional object of classcoeftest
and uses therownames
function on thex
variable to get the correct intercept name onto the resultingci
object.Output when using broom package
SessionInfo
Output when using pull request
Test script