|
22 | 22 | #' |
23 | 23 | #' @examples |
24 | 24 | #' \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 | +#' } |
27 | 42 | #' |
28 | 43 | #' # manually set rates (0.003 and 0.005) and SEs (0.001 and 0.002) |
29 | 44 | #' # so that x = y = c('rate', 'SE') |
30 | 45 | #' rate_ratio(x= c(0.003, 0.001), y= c(0.005, 0.002), SE.method = TRUE) |
31 | 46 | #' |
32 | 47 | #' # observed numbers (10 and 20) and person-years (30000 and 40000): |
33 | 48 | #' rate_ratio(x = c(10, 30000), y = c(20, 40000), SE.method = FALSE) |
34 | | -#' } |
35 | | -#' |
36 | 49 | #' |
37 | 50 | #' @seealso \code{\link{rate}} |
38 | 51 | #' |
|
0 commit comments