Using generateSequenceCohortSet to obtain sequence ratios for the desired outcomes.
Arguments
- cohort
A cohort table in the cdm.
- cohortId
The Ids in the cohort that are to be included in the analyses.
- confidenceInterval
Default is 95, indicating the central 95% confidence interval.
- minCellCount
The minimum number of events to reported, below which results will be obscured. If 0, all results will be reported.
Examples
# \donttest{
library(CohortSymmetry)
cdm <- mockCohortSymmetry()
#> Warning: ! 9 column in cdm_source do not match expected column type:
#> • `cdm_source_abbreviation` is logical but expected character
#> • `cdm_holder` is logical but expected character
#> • `source_description` is logical but expected character
#> • `source_documentation_reference` is logical but expected character
#> • `cdm_etl_reference` is logical but expected character
#> • `source_release_date` is logical but expected date
#> • `cdm_release_date` is logical but expected date
#> • `cdm_version` is numeric but expected character
#> • `vocabulary_version` is logical but expected character
#> Warning: ! 3 column in concept do not match expected column type:
#> • `concept_id` is numeric but expected integer
#> • `valid_start_date` is character but expected date
#> • `valid_end_date` is character but expected date
#> Warning: ! 1 column in vocabulary do not match expected column type:
#> • `vocabulary_concept_id` is numeric but expected integer
#> Warning: ! 5 column in concept_relationship do not match expected column type:
#> • `concept_id_1` is numeric but expected integer
#> • `concept_id_2` is numeric but expected integer
#> • `valid_start_date` is logical but expected date
#> • `valid_end_date` is logical but expected date
#> • `invalid_reason` is logical but expected character
#> Warning: ! 2 column in concept_synonym do not match expected column type:
#> • `concept_id` is numeric but expected integer
#> • `language_concept_id` is numeric but expected integer
#> Warning: ! 4 column in concept_ancestor do not match expected column type:
#> • `ancestor_concept_id` is numeric but expected integer
#> • `descendant_concept_id` is numeric but expected integer
#> • `min_levels_of_separation` is numeric but expected integer
#> • `max_levels_of_separation` is numeric but expected integer
#> Warning: ! 9 column in drug_strength do not match expected column type:
#> • `drug_concept_id` is numeric but expected integer
#> • `ingredient_concept_id` is numeric but expected integer
#> • `amount_unit_concept_id` is numeric but expected integer
#> • `numerator_unit_concept_id` is numeric but expected integer
#> • `denominator_value` is logical but expected numeric
#> • `denominator_unit_concept_id` is numeric but expected integer
#> • `box_size` is numeric but expected integer
#> • `valid_start_date` is character but expected date
#> • `valid_end_date` is character but expected date
#> Warning: There are observation period end dates after the current date: 2024-11-15
#> ℹ The latest max observation period end date found is 2026-10-26
#> Warning: There are observation period end dates after the current date: 2024-11-15
#> ℹ The latest max observation period end date found is 2026-10-26
cdm <- generateSequenceCohortSet(cdm = cdm,
name = "joined_cohorts",
indexTable = "cohort_1",
markerTable = "cohort_2")
pssa_result <- summariseSequenceRatios(cohort = cdm$joined_cohorts, minCellCount = 0)
#> Warning: For at least some combinations, index is always before marker or marker always
#> before index
#> -- 5 combinations of 8 had index always before marker
#> -- 5 combinations of 8 had marker always before index
#> Warning: `cdm_name` is present in both 'settings' and 'summarised_result'. This will be
#> an error in the next release.
#> Warning: `cdm_name` is present in both 'settings' and 'summarised_result'. This will be
#> an error in the next release.
#> Warning: `cdm_name` is present in both 'settings' and 'summarised_result'. This will be
#> an error in the next release.
pssa_result
#> # A tibble: 80 × 13
#> result_id cdm_name group_name group_level strata_name strata_level
#> <int> <chr> <chr> <chr> <chr> <chr>
#> 1 1 mock database index_cohort_na… cohort_1 &… overall overall
#> 2 1 mock database index_cohort_na… cohort_1 &… overall overall
#> 3 1 mock database index_cohort_na… cohort_1 &… overall overall
#> 4 1 mock database index_cohort_na… cohort_1 &… overall overall
#> 5 1 mock database index_cohort_na… cohort_1 &… overall overall
#> 6 1 mock database index_cohort_na… cohort_1 &… overall overall
#> 7 1 mock database index_cohort_na… cohort_1 &… overall overall
#> 8 1 mock database index_cohort_na… cohort_1 &… overall overall
#> 9 1 mock database index_cohort_na… cohort_1 &… overall overall
#> 10 1 mock database index_cohort_na… cohort_1 &… overall overall
#> # ℹ 70 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)
# }