I think that
coef(summary(fit))[,"Pr(>|z|)"]
will provide you with what you want. ( summary.glm() returns an object that has a coef() method that returns a table of coefficients.) (By the way, if access methods exist, it is better to use them than directly access the components of the finished model - for example, coef(fit) better than fit$coef .)
extracts p-values ββand r-square from linear regression gives a similar answer.
I would suggest methods(class="summary.glm") find available access methods, but in fact it is a little more complicated, because the default methods (in this case coef.default() ) can also be relevant ...
PS , if you need Z values, coef(summary(fit))[,"z value"] should do this (your question is a bit ambiguous: usually, when people say "Z statistics", they mean that you need the test statistic value, not the p value)
Ben bolker
source share