Skip to contents

`r lifecycle::badge("deprecated")`

Usage

summariseCharacteristics(
  cohort,
  cdm = lifecycle::deprecated(),
  strata = list(),
  demographics = TRUE,
  ageGroup = NULL,
  tableIntersect = list(),
  cohortIntersect = list(),
  conceptIntersect = list(),
  otherVariables = character()
)

Arguments

cohort

A cohort in the cdm.

cdm

A cdm reference.

strata

Stratification list.

demographics

Whether to summarise demographics data.

ageGroup

A list of age groups.

tableIntersect

A list of arguments that uses addTableIntersect function to add variables to summarise.

cohortIntersect

A list of arguments that uses addCohortIntersect function to add variables to summarise.

conceptIntersect

A list of arguments that uses addConceptIntersect function to add variables to summarise.

otherVariables

Other variables contained in cohort that you want to be summarised.

Value

A summary of the characteristics of the individuals.

Examples

# \donttest{
library(PatientProfiles)

cdm <- mockPatientProfiles()

summariseCharacteristics(
  cohort = cdm$cohort1,
  ageGroup = list(c(0, 19), c(20, 39), c(40, 59), c(60, 79), c(80, 150)),
  tableIntersect = list(
    "Number visits prior year" = list(
      tableName = "visit_occurrence", value = "count", window = c(-365, -1)
    )
  ),
  cohortIntersect = list(
    "Drugs prior year" = list(
      targetCohortTable = "cohort2", value = "flag", window = c(-365, -1)
    ),
    "Conditions any time prior" = list(
      targetCohortTable = "cohort2", value = "flag", window = c(-Inf, -1)
    )
  )
)
#>  adding demographics columns
#>  adding table intersect columns for table: visit_occurrence
#>  adding cohort intersect columns for table: cohort2
#>  adding cohort intersect columns for table: cohort2
#>  summarising data
#>  The following estimates will be computed:
#>  flag_variable_00035_variable_00034: count, percentage
#>  flag_variable_00036_variable_00034: count, percentage
#>  flag_variable_00038_variable_00037: count, percentage
#>  flag_variable_00039_variable_00037: count, percentage
#>  variable_00028: count, percentage
#>  variable_00032: count, percentage
#>  cohort_start_date: min, q05, q25, median, q75, q95, max
#>  cohort_end_date: min, q05, q25, median, q75, q95, max
#>  variable_00030: min, q05, q25, median, q75, q95, max, mean, sd
#>  variable_00031: min, q05, q25, median, q75, q95, max, mean, sd
#>  variable_00029: min, q05, q25, median, q75, q95, max, mean, sd
#>  count_visit_occurrence_variable_00033: min, q05, q25, median, q75, q95, max,
#>   mean, sd
#> ! Table is collected to memory as not all requested estimates are supported on
#>   the database side
#> → Start summary of data, at 2024-05-11 12:04:13.487877
#>  Summary finished, at 2024-05-11 12:04:13.64446
#>  summariseCharacteristics finished!
#> # A tibble: 64 × 13
#>    result_id cdm_name group_name  group_level strata_name strata_level
#>        <int> <chr>    <chr>       <chr>       <chr>       <chr>       
#>  1         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#>  2         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#>  3         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#>  4         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#>  5         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#>  6         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#>  7         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#>  8         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#>  9         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#> 10         1 PP_MOCK  cohort_name cohort_1    overall     overall     
#> # ℹ 54 more rows
#> # ℹ 7 more variables: variable_name <chr>, variable_level <chr>,
#> #   estimate_name <chr>, estimate_type <chr>, estimate_value <chr>,
#> #   additional_name <chr>, additional_level <chr>
CDMConnector::cdmDisconnect(cdm = cdm)
# }