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

riskdifference

Calculate risk difference and its confidence intervals


Description

Calculate risk difference (a kind of attributable risk / excess risk) and its confidence intervals based on approximation, followed by null hypothesis (risk difference equals to 0) testing.

Usage

riskdifference(a, b, N1, N0, CRC=FALSE, conf.level=0.95)

Arguments

a

The number of disease occurence among exposed cohort.

b

The number of disease occurence among non-exposed cohort.

N1

The population at risk of the exposed cohort.

N0

The population at risk of the unexposed cohort.

CRC

Logical. If TRUE, calculate confidence intervals for each risk. Default is FALSE.

conf.level

Probability for confidence intervals. Default is 0.95.

Value

estimate

Calculated point estimate of risk difference.

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 <- riskdifference(321, 411, 686, 689, CRC=TRUE)
 str(res)
 print(res)

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.