Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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)

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.

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.

Author(s)

References

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

Examples

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)

fmsb

Functions for Medical Statistics Book with some Demographic Data

v0.7.1
GPL (>= 2)
Authors
Minato Nakazawa <minato-nakazawa@umin.net>
Initial release
2021-05-09

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.