riskdifference {fmsb} | R Documentation |
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.
riskdifference(a, b, N1, N0, CRC=FALSE, conf.level=0.95)
a |
The number of disease occurence among exposed cohort. |
b |
The number of disease occurence among unexposed cohort. |
N1 |
The population at risk in exposed cohort. |
N0 |
The population at risk in unexposed cohort. |
CRC |
Logical. If TRUE, this function also calculates the risks for each cohort and for both combined, with confidence intervals. Default FALSE. |
conf.level |
Probability for confidence intervals. Default is 0.95. |
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. |
Minato Nakazawa (minato-nakazawa[atmark]umin.net)
Rothman KJ (2012) Epidemiology: An Introduction. 2nd Ed., Oxford University Press, Oxford.
res <- riskdifference(321, 411, 686, 689, CRC=TRUE) str(res) print(res)