In R, If I write:
reg1 <- lm(y ~ x, data = ds)
the regression model information is stored in reg1 which has a structure of a list.
I can write:
value.of.intercept <- reg1$coefficients[1]
to save the value of the intercept to the variable named "value.of.intercept"
What do I write to save the statistical significance value of the intercept to the variable "p.value.of.intercept"?
I can see the value, in the summary. If I write:
summary(reg1)
the statistical significance value of the intercept is immediately under this text: Pr(>|t|)