Skip to content

Commit 343dc7f

Browse files
committed
ensured all rate_ratio() examples pass
1 parent b1fd6f6 commit 343dc7f

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

R/incidence_rates_utils.R

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,30 @@
2222
#'
2323
#' @examples
2424
#' \dontrun{
25-
#' # two rate ratios
26-
#' rate_ratio(rate_obj1, rate_obj2, SE.method = TRUE)
25+
#' # two rate ratios; silly example with female rectal / breast cancer
26+
#' ## mortality rates
27+
#' data("sire", package = "popEpi")
28+
#' data("sibr", package = "popEpi")
29+
#'
30+
#' BL <- list(per = 2000:2005)
31+
#'
32+
#' re <- lexpand(sire, birth = "bi_date", entry = "dg_date", exit = "ex_date",
33+
#' status = status == 1, breaks = BL, aggre = list(per))
34+
#' br <- lexpand(sibr, birth = "bi_date", entry = "dg_date", exit = "ex_date",
35+
#' status = status == 1, breaks = BL, aggre = list(per))
36+
#'
37+
#' r_re <- rate(re, obs = "from0to1", pyrs = "pyrs")
38+
#' r_br <- rate(br, obs = "from0to1", pyrs = "pyrs")
39+
#'
40+
#' rate_ratio(r_re, r_br, SE.method = TRUE)
41+
#' }
2742
#'
2843
#' # manually set rates (0.003 and 0.005) and SEs (0.001 and 0.002)
2944
#' # so that x = y = c('rate', 'SE')
3045
#' rate_ratio(x= c(0.003, 0.001), y= c(0.005, 0.002), SE.method = TRUE)
3146
#'
3247
#' # observed numbers (10 and 20) and person-years (30000 and 40000):
3348
#' rate_ratio(x = c(10, 30000), y = c(20, 40000), SE.method = FALSE)
34-
#' }
35-
#'
3649
#'
3750
#' @seealso \code{\link{rate}}
3851
#'

man/rate_ratio.Rd

Lines changed: 17 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)