[R] Relative Risk in logistic regression

David Winsemius dwinsemius at comcast.net
Wed Jan 30 21:35:52 CET 2013


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



More information about the R-help mailing list