Description Usage Arguments Value References Examples

View source: R/relative.risk.R

This function calculates the relative risk from a contingency table. Furthermore, a confidence interval for the relative risk is provided. Details on the confidence interval can be found in Agresti (2018, ISBN: 978-1-119-40528-3).

1 | ```
relative.risk(A, show.matrix = FALSE, conf.int = FALSE, level = 0.05)
``` |

`A` |
a 2x2 matrix object where A[1,1] contains the number of people with the disease who have been exposed to some condition; A[1,2], the number of people without the disease who have not been exposed this condition; A[2,1], the number of people with the disease who have been exposed to the condition; A[2,2], the number of people without the disease who have not been exposed to some condition. |

`show.matrix` |
a logical value indicating whether the matrix A must be shown. |

`conf.int` |
a logical value indicating whether a confidence interval for the relative risk must be calculated. |

`level` |
level of significance for the confidence interval. |

If `conf.int=TRUE`

, a list of length equal to two. The first element of the list `Relative Risk`

corresponds to the estimation of the relative risk; the second one `Confidence Interval of level`

contains the corresponding confidence interval.

If `conf.int=FALSE`

, a numeric value corresponding to the estimation of the relative risk.

Agresti, A. (2018). An introduction to categorical data analysis. John Wiley & Sons. ISBN: 978-1-119-40528-3.

1 2 3 | ```
A<-matrix(c(744,231,421,659),nrow=2)
relative.risk(A,show.matrix=TRUE,conf.int=TRUE)
relative.risk(A,show.matrix=TRUE,conf.int=TRUE,level=0.1)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.