Package 'mtvc'

Title: Multiple Counting Process Structure for Survival Analysis
Description: Counting process structure is fundamental to model time varying covariates. This package restructures dataframes in the counting process format for one or more variables. F. W. Dekker, et al. (2008) <doi:10.1038/ki.2008.328>.
Authors: Elia Gonzato [aut, cre, cph]
Maintainer: Elia Gonzato <[email protected]>
License: MIT + file LICENSE
Version: 1.1.0
Built: 2025-02-02 03:24:42 UTC
Source: https://github.com/egonzato/mtvc

Help Index


(mtvc) Multiple Time Varying Covariates

Description

Restructure dataset into counting process format to model time varying variables

Usage

mtvc(data, dates, origin = "1970-01-01", start, stop, event, complications)

Arguments

data

Dataframe to be restructured. Has to be in wide format, with a line for each individual.

dates

Name of the columns that contains dates that point out when the variables of interest change value. If an individual does not experience the event of interest, then the respective date should be either a missing value or the origin date.

origin

Day from which the function starts counting days to convert into dates.

start

Date of first contact with the individual (i.e. first medical visit).

stop

Date of death or last visit of the follow-up.

event

Binary variable that indicates if the individual has experienced the event.

complications

Name of the columns that contain values of time varying covariates.

Details

Time varying variables are covariates that might change during the follow-up, so it is fundamental to apply the counting process structure to the data frame of interest, in order to allocate properly the right amount of time that each patient has contributed to the study in each health status.

Value

Dataset in counting process format.

References

1. F. W. Dekker, et al., Survival analysis: time-dependent effects and time-varying risk factors, Kidney International, Volume 74, Issue 8, 2008, Pages 994-997.

Examples

data(simwide)
cp.dataframe=mtvc(data=simwide,
origin='1970-01-01',
dates=c(FIRST_CHRONIC,FIRST_ACUTE,FIRST_RELAPSE),
complications=c(CHRONIC,ACUTE,RELAPSE),
start=DATETRAN,
stop=DLASTSE,
event=EVENT)

This data frame contains variables that are time varying, which might change at a specific time point. In particular, are referred to Graft Versus Host Disease, both Acute and Chronic, and relapse, which is the recurrence of the disease. In addition, this data frame contains specific dates, that refer to the first and last visit of the patient, and the respective dates of each time varying covariate, day from which that variable will change its value.

Description

This data frame contains variables that are time varying, which might change at a specific time point. In particular, are referred to Graft Versus Host Disease, both Acute and Chronic, and relapse, which is the recurrence of the disease. In addition, this data frame contains specific dates, that refer to the first and last visit of the patient, and the respective dates of each time varying covariate, day from which that variable will change its value.

Usage

simwide

Format

A data frame with...

## 'simwide' A data frame with 80 rows and 577 columns:

EVENT

Binary variable that indicates if the individual has experienced the event of interest.

DATETRAN

Date that points out when follow-ip starts.

DLASTSE

Date that points out when follow-ip ends, whether because of the end of the study or the death of the patient.

FIRST_ACUTE

Date of diagnosis of acute GVHD, if not experienced there will be a missing value.

FIRST_CHRONIC

Date of diagnosis of chronic GVHD, if not experienced there will be a missing value.

FIRST_RELAPSE

Date of diagnosis of relapse, if not experienced there will be a missing value.

ACUTE

Indicator variable for acute GVHD.

CHRONIC

Indicator variable for chronic GVHD.

RELAPSE

Indicator variable for relapse.

AGE

Age of patients.

GENDER

Gender of patients.

id

Identifier of patients.

Source

Data simulated referring to Haematopoietic Stem Cells Transplantation (HSCT) settings.