Description Usage Arguments Value Note References Examples

Crude or age-specific rates.

1 | ```
crude_rate(df, events, person_yrs, base = 1e+05, level = 95, decimals = 1)
``` |

`df` |
A data frame. |

`events` |
Number of events. |

`person_yrs` |
Number of person-years at risk. |

`base` |
Multiplier; e.g. per 100,000 population. |

`level` |
Confidence level expressed as percentage. |

`decimals` |
Decimal places to round results. |

A data table with the following fields:

`events`

Number of events.

`person_yrs`

Total person-years at risk.

`rate`

Crude (unadjusted) rate.

`rate_stderr`

Standard error of rate.

`rate_lci`

Lower confidence limit for rate.

`rate_uci`

Upper confidence limit for rate.

Confidence limits for crude rates are computed using the method of Garwood (1936).

Garwood F (1936) Fiducial limits for the Poisson distribution, Biometrika 28:437-442.

1 2 3 4 5 6 | ```
# US cancer rates by year
library(dplyr)
cancer %>%
group_by(Year) %>%
summarize_at(c("n", "pop"), sum) %>%
do(crude_rate(., n, pop))
``` |

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.