to.rr {RelativeRisk}R Documentation

To relative risk

Description

A Logit-Log translation that converts odds ratios into relative risks.

Usage

        to.rr(or,limit=c(1,0),theta=1,scaledIn=TRUE,scaledOut=TRUE,oneSided=FALSE)

Arguments

or A vector of odds ratios,including the constant.
limit A vector or matrix of variable limits (upper,lower). If a matrix, there should be no row for the constant. A vector will be expanded into a matrix.
theta theta*nr for case-control, where theta is the ratio of marginal probabilities theta=(1-P)/P, and nr=(no. Cases)/(no. Controls)
scaledIn If FALSE, the raw glm() coefficients will be expected.
scaledOut If FALSE, unscaled log(rr) will be output.
oneSided TRUE if only the upper limit is to be used.

Details

This function estimates relative risks by using Logit-Log translations from a GLM logistic fit into coefficients for a GLM log fit. The translation is not perfect, but the errors are modest.

For case-control, the cases and controls are assumed to be random samples drawn from two populations. The probability that an individual will belong to the case population is P, and the probability for control is (1-P).

Value

A vector of relative risks including the constant.

Note

Logit-Log translations are obtained by equating the coefficients for p of the logistic and log models.

Author(s)

Bob Wheeler bwheelerg@gmail.com

Please cite this program as follows:

Wheeler, R.E. (2009). to.rr RelativeRisk. The R project for statistical computing http://www.r-project.org/

Examples

      to.rr(to.or(c(.3,1.5,2,.7,.3)))
      round(or<-to.or(c(.3,1.5,2,.7,.3)),2)
          round(to.rr(or,theta=5),2)

[Package RelativeRisk version 1.1-1 Index]