Hi all, I am very grateful to all those who write to me 1) how i can obtain relative risk (risk ratio) in logistic regression in R. 2) how to obtain the predicted risk for a certain individual using fitted regression model in R. Many thanks, in advance, for your help. Amin.
Relative Risk in logistic regression
10 messages · aminreza Aamini, nalluri pratap, Kevin E. Thorpe +3 more
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130130/00d54e0a/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130130/e98b000f/attachment.pl>
On 01/30/2013 09:02 AM, nalluri pratap wrote:
Relative risk = exp(coef(model))
Only if you fit using the log link. Using the logit link, this gives odds ratios.
--- On Wed, 30/1/13, aminreza Aamini <amin.r.fan at gmail.com> wrote: From: aminreza Aamini <amin.r.fan at gmail.com> Subject: [R] Relative Risk in logistic regression To: "R-help" <R-help at r-project.org> Date: Wednesday, 30 January, 2013, 4:19 PM Hi all, I am very grateful to all those who write to me 1) how i can obtain relative risk (risk ratio) in logistic regression in R. 2) how to obtain the predicted risk for a certain individual using fitted regression model in R. Many thanks, in advance, for your help. Amin.
______________________________________________ R-help at r-project.org mailing list 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. [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list 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.
Kevin E. Thorpe Head of Biostatistics, Applied Health Research Centre (AHRC) Li Ka Shing Knowledge Institute of St. Michael's Assistant Professor, Dalla Lana School of Public Health University of Toronto email: kevin.thorpe at utoronto.ca Tel: 416.864.5776 Fax: 416.864.3016
I am not sure why one would want a relative risk from a logistic regression. The measure of association from a logistic regression is the odds ratio, not the relative risk. John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology 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)>>> "Kevin E. Thorpe" <kevin.thorpe at utoronto.ca> 1/30/2013 11:14 AM >>>
On 01/30/2013 09:02 AM, nalluri pratap wrote:
Relative risk = exp(coef(model))
Only if you fit using the log link. Using the logit link, this gives odds ratios.
--- On Wed, 30/1/13, aminreza Aamini <amin.r.fan at gmail.com> wrote: From: aminreza Aamini <amin.r.fan at gmail.com> Subject: [R] Relative Risk in logistic regression To: "R-help" <R-help at r-project.org> Date: Wednesday, 30 January, 2013, 4:19 PM Hi all, I am very grateful to all those who write to me 1) how i can obtain relative risk (risk ratio) in logistic regression in R. 2) how to obtain the predicted risk for a certain individual using fitted regression model in R. Many thanks, in advance, for your help. Amin.
______________________________________________ R-help at r-project.org mailing list 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. [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list 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.
Kevin E. Thorpe Head of Biostatistics, Applied Health Research Centre (AHRC) Li Ka Shing Knowledge Institute of St. Michael's Assistant Professor, Dalla Lana School of Public Health University of Toronto email: kevin.thorpe at utoronto.ca Tel: 416.864.5776 Fax: 416.864.3016 ______________________________________________ R-help at r-project.org mailing list 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. 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/30/2013 11:17 AM, John Sorkin wrote:
I am not sure why one would want a relative risk from a logistic regression. The measure of association from a logistic regression is the odds ratio, not the relative risk. John
Yes, the natural measure, when using the logit link, is the OR. I always use that myself, but if you use the log link, you get RR. As for why you would, I would suggest it's because physicians think they understand a RR better than and OR.
"Kevin E. Thorpe" <kevin.thorpe at utoronto.ca> 1/30/2013 11:14 AM >>> On 01/30/2013 09:02 AM, nalluri pratap wrote:
> Relative risk = exp(coef(model)) >
Only if you fit using the log link. Using the logit link, this gives odds ratios.
> --- On Wed, 30/1/13, aminreza Aamini <amin.r.fan at gmail.com> wrote: > > > From: aminreza Aamini <amin.r.fan at gmail.com> > Subject: [R] Relative Risk in logistic regression > To: "R-help" <R-help at r-project.org> > Date: Wednesday, 30 January, 2013, 4:19 PM > > > Hi all, > I am very grateful to all those who write to me > 1) how i can obtain relative risk (risk ratio) in logistic
regression in R.
> 2) how to obtain the predicted risk for a certain individual using > fitted regression model in R. > > Many thanks, in advance, for your help. > > Amin. > > ______________________________________________ > R-help at r-project.org mailing list > 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. > > [[alternative HTML version deleted]] > > > > ______________________________________________ > R-help at r-project.org mailing list > 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. >
Kevin E. Thorpe Head of Biostatistics, Applied Health Research Centre (AHRC) Li Ka Shing Knowledge Institute of St. Michael's Assistant Professor, Dalla Lana School of Public Health University of Toronto email: kevin.thorpe at utoronto.ca Tel: 416.864.5776 Fax: 416.864.3016
If you use a log link, you are not, I believe, performing a logistic regression! John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology 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)>>> "Kevin E. Thorpe" <kevin.thorpe at utoronto.ca> 1/30/2013 11:22 AM >>>
On 01/30/2013 11:17 AM, John Sorkin wrote:
I am not sure why one would want a relative risk from a logistic regression. The measure of association from a logistic regression is the odds ratio, not the relative risk. John
Yes, the natural measure, when using the logit link, is the OR. I always use that myself, but if you use the log link, you get RR. As for why you would, I would suggest it's because physicians think they understand a RR better than and OR.
"Kevin E. Thorpe" <kevin.thorpe at utoronto.ca> 1/30/2013 11:14 AM >>> On 01/30/2013 09:02 AM, nalluri pratap wrote:
> Relative risk = exp(coef(model)) >
Only if you fit using the log link. Using the logit link, this gives odds ratios.
> --- On Wed, 30/1/13, aminreza Aamini <amin.r.fan at gmail.com> wrote: > > > From: aminreza Aamini <amin.r.fan at gmail.com> > Subject: [R] Relative Risk in logistic regression > To: "R-help" <R-help at r-project.org> > Date: Wednesday, 30 January, 2013, 4:19 PM > > > Hi all, > I am very grateful to all those who write to me > 1) how i can obtain relative risk (risk ratio) in logistic
regression in R.
> 2) how to obtain the predicted risk for a certain individual using > fitted regression model in R. > > Many thanks, in advance, for your help. > > Amin. > > ______________________________________________ > R-help at r-project.org mailing list > 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. > > [[alternative HTML version deleted]] > > > > ______________________________________________ > R-help at r-project.org mailing list > 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. >
Kevin E. Thorpe Head of Biostatistics, Applied Health Research Centre (AHRC) Li Ka Shing Knowledge Institute of St. Michael's Assistant Professor, Dalla Lana School of Public Health University of Toronto email: kevin.thorpe at utoronto.ca Tel: 416.864.5776 Fax: 416.864.3016 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/30/2013 11:26 AM, John Sorkin wrote:
If you use a log link, you are not, I believe, performing a logistic regression!
I guess strictly speaking, that is true. I was being a little sloppy in terminology.
"Kevin E. Thorpe" <kevin.thorpe at utoronto.ca> 1/30/2013 11:22 AM >>> On 01/30/2013 11:17 AM, John Sorkin wrote:
> I am not sure why one would want a relative risk from a logistic > regression. The measure of association from a logistic regression is the > odds ratio, not the relative risk. > John >
Yes, the natural measure, when using the logit link, is the OR. I always use that myself, but if you use the log link, you get RR. As for why you would, I would suggest it's because physicians think they understand a RR better than and OR.
> "Kevin E. Thorpe" <kevin.thorpe at utoronto.ca> 1/30/2013 11:14 AM >>> > On 01/30/2013 09:02 AM, nalluri pratap wrote:
> > Relative risk = exp(coef(model)) > >
> > Only if you fit using the log link. Using the logit link, this gives > odds ratios. >
> > --- On Wed, 30/1/13, aminreza Aamini <amin.r.fan at gmail.com> wrote: > > > > > > From: aminreza Aamini <amin.r.fan at gmail.com> > > Subject: [R] Relative Risk in logistic regression > > To: "R-help" <R-help at r-project.org> > > Date: Wednesday, 30 January, 2013, 4:19 PM > > > > > > Hi all, > > I am very grateful to all those who write to me > > 1) how i can obtain relative risk (risk ratio) in logistic
> regression in R.
> > 2) how to obtain the predicted risk for a certain individual using > > fitted regression model in R. > > > > Many thanks, in advance, for your help. > > > > Amin. > > > > ______________________________________________ > > R-help at r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide
> > and provide commented, minimal, self-contained, reproducible code. > > > > [[alternative HTML version deleted]] > > > >
Kevin E. Thorpe Head of Biostatistics, Applied Health Research Centre (AHRC) Li Ka Shing Knowledge Institute of St. Michael's Assistant Professor, Dalla Lana School of Public Health University of Toronto email: kevin.thorpe at utoronto.ca Tel: 416.864.5776 Fax: 416.864.3016
On Jan 30, 2013, at 5:49 AM, aminreza Aamini wrote:
Hi all, I am very grateful to all those who write to me 1) how i can obtain relative risk (risk ratio) in logistic regression in R. 2) how to obtain the predicted risk for a certain individual using fitted regression model in R.
You obtain the predicted probabilities with something like: predict(model, data.frame(x1="a", x2=30), type = "response") See ?predict.glm This would give the odds ratios (similar but larger than the risk ratios): exp(coef(model))
David Winsemius, MD Alameda, CA, USA
I am curious why one would want risk ratios. Unlike odds ratios, they are not interpretable without reference to the base risk. For example a risk ratio of 2 cannot possibly apply to anyone with a starting risk exceeding 1/2. I think it is most helpful to use one of the existing nomograms to show someone how the base risk and odds ratio translate to final risk, for a range of base risk. Frank David Winsemius wrote
On Jan 30, 2013, at 5:49 AM, aminreza Aamini wrote:
Hi all, I am very grateful to all those who write to me 1) how i can obtain relative risk (risk ratio) in logistic regression in R. 2) how to obtain the predicted risk for a certain individual using fitted regression model in R.
You obtain the predicted probabilities with something like: predict(model, data.frame(x1="a", x2=30), type = "response") See ?predict.glm This would give the odds ratios (similar but larger than the risk ratios): exp(coef(model)) -- David Winsemius, MD Alameda, CA, USA
______________________________________________
R-help@
mailing list
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.
----- Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/Relative-Risk-in-logistic-regression-tp4657040p4657163.html Sent from the R help mailing list archive at Nabble.com.