summariseConceptIdCounts {OmopSketch} | R Documentation |
Summarise concept use in patient-level data. Only concepts recorded during observation period are counted.
Description
Summarise concept use in patient-level data. Only concepts recorded during observation period are counted.
Usage
summariseConceptIdCounts(
cdm,
omopTableName,
countBy = "record",
year = lifecycle::deprecated(),
interval = "overall",
sex = FALSE,
ageGroup = NULL,
sample = NULL,
dateRange = NULL
)
Arguments
cdm |
A cdm object |
omopTableName |
A character vector of the names of the tables to summarise in the cdm object. |
countBy |
Either "record" for record-level counts or "person" for person-level counts |
year |
deprecated |
interval |
Time interval to stratify by. It can either be "years", "quarters", "months" or "overall". |
sex |
TRUE or FALSE. If TRUE code use will be summarised by sex. |
ageGroup |
A list of ageGroup vectors of length two. Code use will be thus summarised by age groups. |
sample |
An integer to sample the tables to only that number of records. If NULL no sample is done. |
dateRange |
A vector of two dates defining the desired study period.
Only the |
Value
A summarised_result object with results overall and, if specified, by strata.
Examples
library(OmopSketch)
library(CDMConnector)
library(duckdb)
requireEunomia()
con <- dbConnect(duckdb(), eunomiaDir())
cdm <- cdmFromCon(con = con, cdmSchema = "main", writeSchema = "main")
summariseConceptIdCounts(cdm = cdm, omopTableName = "condition_occurrence",
countBy = c("record", "person"), sex = TRUE)