comorbidity_window: Limit our comorbidities / multimorbidity measures to a...

View source: R/comorbidity-window.R

comorbidity_windowR Documentation

Limit our comorbidities / multimorbidity measures to a specific time window.

Description

comorbidity_window returns a dataset of claims which fall within a specific timeframe.

Usage

comorbidity_window(
  dat = NULL,
  id_dat = NULL,
  id = NULL,
  id_date = NULL,
  claims_date = NULL,
  time_pre = Inf,
  time_post = Inf
)

Arguments

dat

dataset

id_dat

dataset with our other identifying variables, this should be 1 row per person

id

ID variable which will be used to match and merge

id_date

name of the date of interest from the identification dataset, for example a date of diagnosis

claims_date

name for the variable in the claims data (dat) which is the date of the claim

time_pre

number to limit how many days, pre diagnosis, should be included. Default will be infinity (all claims)

time_post

similar to time_pre, but this will be after the date of interest

Details

This function takes prepared data, using the 'prepare_data' function, along with an identification dataset to limit the claims of interest to a specific time window.

Value

dataframe with which has limited the claims to a specific window

Examples

comorbidity_window(id_dat = id, dat = prepared_data, id = patient_id,
id_date = date_of_interest9, claims_date = claim_date, time_pre = 60)



multimorbidity documentation built on Feb. 16, 2023, 5:57 p.m.