How can I get the p values from a glm ? I want to get the p values so I can add them to a custom report fitwean<- glm(data[,"JWean"]~data[,"Group"],data=data,family=binomial(link ="logit")) summary(fitwean) # This lists the coefficeints, SEs, z and p values, but I can't isolate the pvalues. names(summary(fitwean)) # I see the coefficients, but not the p values names(fitmens) # p values are not found here. Thank you! John John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) Confidentiality Statement: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
On 01/04/2016 6:14 PM, John Sorkin wrote: > How can I get the p values from a glm ? I want to get the p values so I can add them to a custom report > > > fitwean<- glm(data[,"JWean"]~data[,"Group"],data=data,family=binomial(link ="logit")) > summary(fitwean) # This lists the coefficeints, SEs, z and p values, but I can't isolate the pvalues. > names(summary(fitwean)) # I see the coefficients, but not the p values > names(fitmens) # p values are not found here. Doesn't summary(fitwean) give a matrix? Then it's colnames(summary(fitwean)$coefficients) you want, not names(fitwean). Duncan Murdoch P.S. If you had given a reproducible example, I'd try it myself. > > Thank you! > John > > John David Sorkin M.D., Ph.D. > Professor of Medicine > Chief, Biostatistics and Informatics > University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > (Phone) 410-605-7119 > (Fax) 410-605-7913 (Please call phone number above prior to faxing) > > Confidentiality Statement: > This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
... of course, whether one **should** get them is questionable... http://www.nature.com/news/statisticians-issue-warning-over-misuse-of-p-values-1.19503#/ref-link-1 Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Apr 1, 2016 at 3:26 PM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:> On 01/04/2016 6:14 PM, John Sorkin wrote: >> How can I get the p values from a glm ? I want to get the p values so I >> can add them to a custom report >> >> >> fitwean<- >> glm(data[,"JWean"]~data[,"Group"],data=data,family=binomial(link ="logit")) >> summary(fitwean) # This lists the coefficeints, SEs, z and p >> values, but I can't isolate the pvalues. >> names(summary(fitwean)) # I see the coefficients, but not the p values >> names(fitmens) # p values are not found here. > > Doesn't summary(fitwean) give a matrix? Then it's > colnames(summary(fitwean)$coefficients) you want, not names(fitwean). > > Duncan Murdoch > > P.S. If you had given a reproducible example, I'd try it myself. > > > >> >> Thank you! >> John >> >> John David Sorkin M.D., Ph.D. >> Professor of Medicine >> Chief, Biostatistics and Informatics >> University of Maryland School of Medicine Division of Gerontology and >> Geriatric Medicine >> Baltimore VA Medical Center >> 10 North Greene Street >> GRECC (BT/18/GR) >> Baltimore, MD 21201-1524 >> (Phone) 410-605-7119 >> (Fax) 410-605-7913 (Please call phone number above prior to faxing) >> >> Confidentiality Statement: >> This email message, including any attachments, is for the sole use of the >> intended recipient(s) and may contain confidential and privileged >> information. Any unauthorized use, disclosure or distribution is prohibited. >> If you are not the intended recipient, please contact the sender by reply >> email and destroy all copies of the original message. >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.