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 |
Restructure dataset into counting process format to model time varying variables
mtvc(data, dates, origin = "1970-01-01", start, stop, event, complications)
mtvc(data, dates, origin = "1970-01-01", start, stop, event, complications)
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. |
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.
Dataset in counting process format.
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.
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)
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.
simwide
simwide
A data frame with...
## 'simwide' A data frame with 80 rows and 577 columns:
Binary variable that indicates if the individual has experienced the event of interest.
Date that points out when follow-ip starts.
Date that points out when follow-ip ends, whether because of the end of the study or the death of the patient.
Date of diagnosis of acute GVHD, if not experienced there will be a missing value.
Date of diagnosis of chronic GVHD, if not experienced there will be a missing value.
Date of diagnosis of relapse, if not experienced there will be a missing value.
Indicator variable for acute GVHD.
Indicator variable for chronic GVHD.
Indicator variable for relapse.
Age of patients.
Gender of patients.
Identifier of patients.
Data simulated referring to Haematopoietic Stem Cells Transplantation (HSCT) settings.