knitr::opts_chunk$set( warning = FALSE, message = FALSE, collapse = TRUE, comment = "#>", fig.width = 7, fig.height = 5, eval = Sys.getenv("$RUNNER_OS") != "macOS" )
if (Sys.getenv("EUNOMIA_DATA_FOLDER") == "") Sys.setenv("EUNOMIA_DATA_FOLDER" = tempdir()) if (!dir.exists(Sys.getenv("EUNOMIA_DATA_FOLDER"))) dir.create(Sys.getenv("EUNOMIA_DATA_FOLDER")) if (!CDMConnector::eunomiaIsAvailable()) CDMConnector::downloadEunomiaData()
In this vignette we will explore the functionality and arguments of summariseSequenceRatios()
function, which is used to generate the sequence ratios of the SSA. As this function uses the output of generateSequenceCohortSet()
function (explained in detail in the vignette: Step 1. Generate a sequence cohort), we will pick up the explanation from where we left off in the previous vignette.
# Load libraries library(CDMConnector) library(dplyr) library(DBI) library(CohortSymmetry) library(duckdb) library(DrugUtilisation) # Connect to the database db <- DBI::dbConnect(duckdb::duckdb(), dbdir = CDMConnector::eunomiaDir()) cdm <- cdmFromCon( con = db, cdmSchema = "main", writeSchema = "main" ) cdm <- DrugUtilisation::generateIngredientCohortSet( cdm = cdm, name = "aspirin", ingredient = "aspirin") cdm <- DrugUtilisation::generateIngredientCohortSet( cdm = cdm, name = "acetaminophen", ingredient = "acetaminophen")
Recall that in the previous vignette: Step 1. Generate a sequence cohort, we've generated cdm$aspirin
and cdm$acetaminophen
before and using them we could generate cdm$intersect
like so:
# Generate a sequence cohort cdm <- generateSequenceCohortSet( cdm = cdm, indexTable = "aspirin", markerTable = "acetaminophen", name = "intersect", combinationWindow = c(0,Inf))
One can obtain the crude and adjusted sequence ratios (with its corresponding confidence intervals) using summariseSequenceRatios()
function:
summariseSequenceRatios( cohort = cdm$intersect ) |> dplyr::glimpse()
The obtained output has a summarised result format. In the later vignette (Step 3. Visualise results) we will explore how to visualise the results in a more intuitive way.
CDMConnector::cdmDisconnect(cdm = cdm)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.