fmsb (version 0.7.6)

riskratio: Calculate risk ratio and its confidence intervals

Description

Calculate risk ratio (a kind of relative risk) and its confidence intervals based on approximation, followed by null hypothesis (risk ratio equals to 1) testing.

Usage

riskratio(X, Y, m1, m2, conf.level=0.95, p.calc.by.independence=TRUE)

Value

estimate

Calculated point estimate of risk ratio.

conf.int

A numeric vector of length 2 to give upper/lower limit of confidence intervals.

p.value

The significant probability of the result of null-hypothesis testing.

Arguments

X

The number of disease occurence among exposed cohort.

Y

The number of disease occurence among non-exposed cohort.

m1

The number of individuals in exposed cohort group.

m2

The number of individuals in non-exposed cohort group.

conf.level

Probability for confidence intervals. Default is 0.95.

p.calc.by.independence

Logical. If TRUE, calculating p-value by testing the null-hypothesis of independence between exposure and disease. Otherwise, calculating p-value by inverse-function of confidence intervals calculation (the result becomes the same as the vcd package). Default TRUE.

References

Rothman KJ (2012) Epidemiology: An Introduction. 2nd Ed., Oxford University Press, Oxford.

Examples

Run this code
 res <- riskratio(5, 10, 90, 90)
 str(res)
 print(res)
 riskratio(12, 5, 18, 17)
 riskratio(12, 5, 18, 17, p.calc.by.independence=FALSE)

Run the code above in your browser using DataLab