Skip to contents

Table of incidence results

Usage

tableIncidence(
  result,
  type = "gt",
  header = c("estimate_name"),
  groupColumn = c("cdm_name", "outcome_cohort_name"),
  settingsColumn = c("denominator_age_group", "denominator_sex"),
  hide = c("denominator_cohort_name", "analysis_interval"),
  .options = list()
)

Arguments

result

Incidence results

type

Type of table. Can be "gt", "flextable", or "tibble"

header

A vector specifying the elements to include in the header. The order of elements matters, with the first being the topmost header. The header vector can contain one of the following variables: "cdm_name", "denominator_cohort_name", "outcome_cohort_name", "incidence_start_date", "incidence_end_date", "estimate_name", variables in the strata_name column, and any of the settings columns specified in settingsColumn argument. The header can also include other names to use as overall header labels

groupColumn

Variables to use as group labels. Allowed columns are the same as in header

settingsColumn

Variables from the settings attribute to display in the table

hide

Table columns to exclude, options are the ones described in header

.options

Table options to apply

Value

Table of results

Examples

# \donttest{
cdm <- mockIncidencePrevalence(sampleSize = 1000)
cdm <- generateDenominatorCohortSet(
  cdm = cdm, name = "denominator",
  cohortDateRange = c(as.Date("2008-01-01"), as.Date("2018-01-01"))
)
#>  Creating denominator cohorts
#> ! cohort columns will be reordered to match the expected order:
#>   cohort_definition_id, subject_id, cohort_start_date, and cohort_end_date.
#>  Cohorts created in 0 min and 2 sec
inc <- estimateIncidence(
  cdm = cdm,
  denominatorTable = "denominator",
  outcomeTable = "outcome"
)
#>  Getting incidence for analysis 1 of 1
#>  Overall time taken: 0 mins and 1 secs
tableIncidence(inc)
Incidence start date Incidence end date Denominator age group Denominator sex
Estimate name
Denominator (N) Person-years Outcome (N) Incidence 100,000 person-years [95% CI]
mock; cohort_1
2008-01-01 2008-12-31 0 to 150 Both 42 33.05 9 27,230.64 (12,451.58 - 51,692.24)
2009-01-01 2009-12-31 0 to 150 Both 38 28.74 13 45,229.98 (24,083.06 - 77,344.64)
2010-01-01 2010-12-31 0 to 150 Both 25 19.69 8 40,623.57 (17,538.37 - 80,044.63)
2011-01-01 2011-12-31 0 to 150 Both 17 11.57 7 60,485.61 (24,318.35 - 124,623.48)
2012-01-01 2012-12-31 0 to 150 Both 10 9.86 1 10,137.88 (256.67 - 56,484.62)
2013-01-01 2013-12-31 0 to 150 Both 9 8.74 1 11,446.89 (289.81 - 63,777.97)
2014-01-01 2014-12-31 0 to 150 Both 8 6.36 2 31,461.38 (3,810.12 - 113,649.33)
2015-01-01 2015-12-31 0 to 150 Both 6 3.86 4 103,761.35 (28,271.48 - 265,670.26)
2016-01-01 2016-12-31 0 to 150 Both 2 1.11 1 90,415.91 (2,289.13 - 503,765.23)
# }