In R, you can do "summary(glm(y ~ x))" and it displays the results of the glm including the intercept, slope and the p-values for the intercept and the slope. But how can you programmatically retrieve the p-value for the slope? For instance, I would like to do something like the following:
rst <- glm(y ~ x)
rst$pvalue
Or, alternatively, a perl package with the desired capability. I've checked out Statistics::LineFit, however it can only return rSquared but not p-value
Alternatively (for readability)
p<-summary(glm(...))$coefficients[2,4]
?Didn't realize summary(..)$coefficients returns a matrix.
Thanks a lot!