Search code examples
rlmsummarybroom

Difference in p-values between summary() vs glance()?


I'm noticing a difference in the p-values when calling summary() on a linear model object versus calling broom::glance(). I think the floating point precision when calling summary() is limited to 2.2e-16 while glance can reach beyond 1e-100. Is my suspicion correct, or are these values inherently different?

x <- c(1, 2, 3, 4, 5, 6, 7, 8, 9)
y <- c(10, 20, 30, 40, 50, 60, 70, 80, 90)

mod <- lm(y~x)

summary(mod) # p < 2.2e-16

broom::glance(mod) # p = 4.66e-112

Solution

  • It is just a matter of visualization,

    summary(mod) says that p-value is less than 2.2e-16 (<2.2e-16), not equal.

    For example, if you run

    summary(mod)$coefficient you get 4.66e-112

    Best