Skip to contents

Table of incidence results

Usage

tableIncidence(
  result,
  type = "gt",
  header = c("estimate_name"),
  groupColumn = character(),
  settingsColumns = colnames(settings(result)),
  hide = character(),
  .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 settingsColumns 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

settingsColumns

Variables from the settings atribute to dispaly 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 <- mockIncidencePrevalenceRef(sampleSize = 1000)
cdm <- generateDenominatorCohortSet(
  cdm = cdm, name = "denominator",
  cohortDateRange = c(as.Date("2008-01-01"), as.Date("2018-01-01"))
)
#>  Creating denominator cohorts
#>  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)
Database name Denominator cohort name Outcome cohort name Incidence start date Incidence end date Result type Package name Package version Analysis outcome washout Analysis repeated events Analysis interval Analysis complete database intervals Denominator age group Denominator sex Denominator days prior observation Denominator start date Denominator end date Denominator time at risk Denominator target cohort name Min cell count
Estimate name
Denominator (N) Person-years Outcome (N) Incidence 100 person-years [95% CI]
mock denominator_cohort_1 cohort_1 2008-01-01 2008-12-31 incidence IncidencePrevalence 0.8.0 inf FALSE years TRUE 0 to 150 Both 0 2008-01-01 2018-01-01 0 to Inf None 5 42 33.05 9 27,230.64 (12,451.58 - 51,692.24)
2009-01-01 2009-12-31 incidence IncidencePrevalence 0.8.0 inf FALSE years TRUE 0 to 150 Both 0 2008-01-01 2018-01-01 0 to Inf None 5 38 28.74 13 45,229.98 (24,083.06 - 77,344.64)
2010-01-01 2010-12-31 incidence IncidencePrevalence 0.8.0 inf FALSE years TRUE 0 to 150 Both 0 2008-01-01 2018-01-01 0 to Inf None 5 25 19.69 8 40,623.57 (17,538.37 - 80,044.63)
2011-01-01 2011-12-31 incidence IncidencePrevalence 0.8.0 inf FALSE years TRUE 0 to 150 Both 0 2008-01-01 2018-01-01 0 to Inf None 5 17 11.57 7 60,485.61 (24,318.35 - 124,623.48)
2012-01-01 2012-12-31 incidence IncidencePrevalence 0.8.0 inf FALSE years TRUE 0 to 150 Both 0 2008-01-01 2018-01-01 0 to Inf None 5 10 <5 <5 <5 (<5 - <5)
2013-01-01 2013-12-31 incidence IncidencePrevalence 0.8.0 inf FALSE years TRUE 0 to 150 Both 0 2008-01-01 2018-01-01 0 to Inf None 5 9 <5 <5 <5 (<5 - <5)
2014-01-01 2014-12-31 incidence IncidencePrevalence 0.8.0 inf FALSE years TRUE 0 to 150 Both 0 2008-01-01 2018-01-01 0 to Inf None 5 8 <5 <5 <5 (<5 - <5)
2015-01-01 2015-12-31 incidence IncidencePrevalence 0.8.0 inf FALSE years TRUE 0 to 150 Both 0 2008-01-01 2018-01-01 0 to Inf None 5 6 <5 <5 <5 (<5 - <5)
2016-01-01 2016-12-31 incidence IncidencePrevalence 0.8.0 inf FALSE years TRUE 0 to 150 Both 0 2008-01-01 2018-01-01 0 to Inf None 5 <5 <5 <5 <5 (<5 - <5)
# }