Type: | Package |
Title: | Multiple Counting Process Structure for Survival Analysis |
Version: | 1.1.0 |
Maintainer: | Elia Gonzato <elia.gonzato@outlook.it> |
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>. |
License: | MIT + file LICENSE |
URL: | https://github.com/egonzato/mtvc |
BugReports: | https://github.com/egonzato/mtvc/issues |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.2.3 |
Imports: | dplyr, tidyr |
Depends: | R (≥ 4.3.0) |
Suggests: | testthat (≥ 3.0.0) |
Config/testthat/edition: | 3 |
NeedsCompilation: | no |
Packaged: | 2024-02-08 20:00:12 UTC; Elia Gonzato |
Author: | Elia Gonzato [aut, cre, cph] |
Repository: | CRAN |
Date/Publication: | 2024-02-09 00:20:05 UTC |
(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 contain 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 variable, day from which that factor 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 variable, day from which that factor will change its value.
Usage
simwide
Format
'simwide' A data frame with 47 rows and 12 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.