Extract pvalue from glm
I'm running many regressions and am only interested in the effect on the coefficient and p-value of one particular variable. So, in my script, I'd like to be able to just extract the p-value from the glm summary (getting the coefficient itself is easy). The only way I know of to view the p-value is using summary(myReg). Is there some other way? e.g.: fit <- glm(y ~ x1 + x2, myData) x1Coeff <- fit$coefficients[2] # only returns coefficient, of course x1pValue <- ??? I've tried treating fit$coefficients as a matrix, but am still unable to simply extract the p-value. Is it possible to do this?