Skip to contents

Table of incidence attrition results

Usage

tableIncidenceAttrition(
  result,
  type = "gt",
  header = "variable_name",
  groupColumn = c("cdm_name", "outcome_cohort_name"),
  settingsColumn = NULL,
  hide = c("denominator_cohort_name", "estimate_name", "reason_id", "variable_level")
)

Arguments

result

A summarised_result object. Output of summariseCohortAttrition().

type

Type of table. Check supported types with visOmopResults::tableType().

header

Columns to use as header. See options with colnames(omopgenerics::splitAll(result)). Variables in settingsColumn are also allowed

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

Value

A visual table.

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
tableIncidenceAttrition(inc)
Reason
Variable name
Number records Number subjects Excluded records Excluded subjects
mock; cohort_1
Starting population 1,000 1,000 - -
Missing year of birth 1,000 1,000 0 0
Missing sex 1,000 1,000 0 0
Cannot satisfy age criteria during the study period based on year of birth 1,000 1,000 0 0
No observation time available during study period 70 70 930 930
Doesn't satisfy age criteria during the study period 70 70 0 0
Prior history requirement not fulfilled during study period 70 70 0 0
No observation time available after applying age, prior observation and, if applicable, target criteria 70 70 0 0
Starting analysis population 140 70 - -
Excluded due to prior event (do not pass outcome washout during study period) 47 47 93 23
Not observed during the complete database interval 47 47 0 0
# }