Skip to contents

Table of prevalence attrition results

Usage

tablePrevalenceAttrition(
  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
prev <- estimatePointPrevalence(
  cdm = cdm,
  denominatorTable = "denominator",
  outcomeTable = "outcome",
  interval = "months"
)
#>  Getting prevalence for analysis 1 of 1
#>  Time taken: 0 mins and 1 secs
tablePrevalenceAttrition(prev)
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 70 70 - -
Not observed during the complete database interval 70 70 0 0
Do not satisfy full contribution requirement for an interval 70 70 0 0
# }