0

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
philiporlando
  • 941
  • 4
  • 19
  • 31

2 Answers2

2

They are the same. Please see the P value from summary after we print the coefficient.

summary(mod) 

s$coefficients
#                 Estimate   Std. Error      t value      Pr(>|t|)
# (Intercept) 9.473903e-15 3.161050e-15 2.997075e+00  2.002483e-02
# x           1.000000e+01 5.617334e-16 1.780204e+16 4.661081e-112
www
  • 38,575
  • 12
  • 48
  • 84
2

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

LocoGris
  • 4,432
  • 3
  • 15
  • 30