If I do
data(mtcars)
m1 <- lm(mpg ~ cyl, data= mtcars, x= TRUE, y= TRUE)
then I can extract the p-value for the slope using summary(m1)$coefficients[2, 4].
But if I do
library(rms)
data(mtcars)
m2 <- ols(mpg ~ cyl, data= mtcars, x= TRUE, y= TRUE)
what do I need to do to extract the p-value for the slope?
You can use the corresponding extractor function, but you need to call
summary.lm: