Title: | Continuous Time Causal Models |
---|---|
Description: | Implements the semiparametric efficient estimators of continuous-time causal models for time-varying treatments and confounders in the presence of dependent censoring (including structural failure time model and Cox proportional hazards marginal structural model). S. Yang, K. Pieper, and F. Cools (2019) <doi:10.1111/biom.12845>. |
Authors: | Shu Yang [aut], Shannon T. Holloway [aut, cre] |
Maintainer: | Shannon T. Holloway <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.1 |
Built: | 2025-01-27 03:40:14 UTC |
Source: | https://github.com/cran/contTimeCausal |
This data set is provided for the purposes of illustrating the use of the software. It includes a one-dimensional baseline covariate and a one-dimensional time-dependent covariate.
data(ctcData)
data(ctcData)
ctcData is a data.frame containing data for 1,000 participants. The data.frame contains 9 columns:
An integer participant identifier.
The left side of the time interval for time-dependent covariate xt.
The right side of the time interval for time-dependent covariate xt.
A continuous time-dependent covariate.
A continuous baseline covariate.
A binary indicator of the clinical event. If the clinical event occurred, takes value 1; otherwise 0.
A binary indicator of treatment discontinuation. If treatment discontinuation was optional, takes value 1. If treatment discontinuation was due to the clinical event, censoring, or a treatment-terminating event, takes value 0.
The time to the clinical event or censoring.
The time to optimal treatment discontinuation, the clinical event, censoring, or a treatment-terminating event.
The function estimates the effect of treatment regime (in terms of time to treatment discontinuation) for a survival outcome under a Cox proportional hazards model with time-varying confounding in the presence of dependent censoring. Studying the effect of time to treatment initiation is applicable by redefining "treatment discontinuation" in the current description to "treatment initiation".
ctCoxMSM(data, base = NULL, td = NULL)
ctCoxMSM(data, base = NULL, td = NULL)
data |
A data.frame object. A data.frame containing all observed data. At a minimum, this data.frame must contain columns with headers "id", "U", "V", "deltaU", and "deltaV". If time-dependent covariates are included, additional columns include "stop" and "start". See Details for further information |
base |
A character or integer vector or NULL. The columns of data to be included in the time-independent component of the model. If NULL, time-independent covariates are excluded from the Cox model for treatment discontinuation. |
td |
A character or integer vector or NULL. The columns of data to be included in the time-dependent component of the model. If NULL, time-dependent covariates are excluded from the Cox model for treatment discontinuation. |
The Cox marginal structural model (MSM) assumes that the potential failure
time
under the treatment
follows a proportional hazards
model with
. We assume that the participant continuously
received treatment until time
. The observed failure time can be
censored assuming the censoring time is independent of the failure time
given the treatment and covariate history (the so-called ignorable
censoring). The function allows for multi-dimensional
baseline covariates and/or multi-dimensional time-dependent covariates.
Variance estimates can be implemented by delete-one-group jackknifing
and recalling ctCoxMSM.
If only time-independent covariates are included, the data.frame must contain the following columns:
A unique participant identifier.
The time to the clinical event or censoring.
The clinical event indicator (1 if U is the event time; 0 otherwise).
The time to optional treatment discontinuation, a clinical event, censoring, or a treatment-terminating event.
The indicator of optional treatment discontinuation (1 if treatment discontinuation was optional; 0 if treatment discontinuation was due to a clinical event, censoring or a treatment-terminating event).
If time-dependent covariates are to be included, the data.frame must be a time-dependent dataset as described by package survival. Specifically, the time-dependent data must be specified for an interval (lower,upper] and the data must include the following additional columns:
The lower boundary of the time interval to which the data pertain.
The upper boundary of the time interval to which the data pertain.
An S3 object of class ctc. Object contains element ‘psi’, the estimate of the Cox MSM parameter(s) and ‘coxPH’, the Cox regression for V.
Yang, S., A. A. Tsiatis, and M. Blazing (2018). Modeling survival distribution as a function of time to treatment discontinuation: A dynamic treatment regime approach, Biometrics, 74, 900–909.
data(ctcData) # sample data to reduce computation time of example smp <- ctcData$id %in% sample(1:1000, 150, FALSE) ctcData <- ctcData[smp,] # analysis with both time-dependent and time-independent components res <- ctCoxMSM(data = ctcData, base = "x", td = "xt") # analysis with only the time-independent component res <- ctCoxMSM(data = ctcData, base = "x") # analysis with only the time-dependent component res <- ctCoxMSM(data = ctcData, td = "xt")
data(ctcData) # sample data to reduce computation time of example smp <- ctcData$id %in% sample(1:1000, 150, FALSE) ctcData <- ctcData[smp,] # analysis with both time-dependent and time-independent components res <- ctCoxMSM(data = ctcData, base = "x", td = "xt") # analysis with only the time-independent component res <- ctCoxMSM(data = ctcData, base = "x") # analysis with only the time-dependent component res <- ctCoxMSM(data = ctcData, td = "xt")
The function estimates the regime (in terms of time to treatment initiation) of treatment effect for a survival outcome under a Structural Failure Time Model (SFTM) with time-varying confounding in the presence of dependent censoring. Studying the effect of time to treatment discontinuation is applicable by redefining "treatment initiation" in the current description to "treatment discontinuation".
ctSFTM(data, base = NULL, td = NULL)
ctSFTM(data, base = NULL, td = NULL)
data |
A data.frame object. A data.frame containing all observed data. At a minimum, this data.frame must contain columns with headers "id", "U", "V", "deltaU", and "deltaV". If time-dependent covariates are included, additional columns include "stop" and "start". See Details for further information |
base |
A character or integer vector or NULL. The columns of data to be included in the time-independent component of the model. If NULL, time-independent covariates are excluded from the Cox model for treatment discontinuation. |
td |
A character or integer vector or NULL. The columns of data to be included in the time-dependent component of the model. If NULL, time-dependent covariates are excluded from the Cox model for treatment discontinuation. |
The SFTM assumes that the potential failure time U
had the individual
never received treatment and the observed failure time T
follow
where ~
means "has the same distribution as", and is the
treatment indicator at time
.
We assume that the individual continuously received treatment until
time
. The observed failure time can be censored assuming the
censoring time is independent of the failure time given the treatment and
covariate history (the so-called ignorable censoring). The current
function allows for multi-dimensional baseline covariates and/or
multi-dimensional time-dependent covariate.
Variance estimates should be implemented by delete-one-group jackknifing
and recalling ctSFTM.
If only time-independent covariates are included, the data.frame must contain the following columns:
A unique participant identifier.
The time to the clinical event or censoring.
The clinical event indicator (1 if U is the event time; 0 otherwise.
The time to optional treatment discontinuation, a clinical event, censoring, or a treatment-terminating event.
The indicator of optional treatment discontinuation (1 if treatment discontinuation was optional; 0 if treatment discontinuation was due to a clinical event, censoring or a treatment-terminating event.
If time-dependent covariates are to be included, the data.frame must be a time-dependent dataset as described by package survival. Specifically, the time-dependent data must be specified for an interval (lower,upper] and the data must include the following additional columns:
The lower boundary of the time interval to which the data pertain.
The upper boundary of the time interval to which the data pertain.
An S3 object of class ctc. Object contains element ‘psi’, the estimate of the SFTM parameter(s) and ‘coxPH’, the Cox regression for V.
Yang, S., K. Pieper, and F. Cools. (2019) Semiparametric estimation of structural failure time model in continuous-time processes. Biometrika, 107(1), 123-136.
data(ctcData) # sample data to reduce computation time of example smp <- ctcData$id %in% sample(1:1000, 200, FALSE) ctcData <- ctcData[smp,] # analysis with both time-dependent and time-independent components res <- ctSFTM(data = ctcData, base = "x", td = "xt") # analysis with only the time-independent component res <- ctSFTM(data = ctcData, base = "x") # analysis with only the time-dependent component res <- ctSFTM(data = ctcData, td = "xt")
data(ctcData) # sample data to reduce computation time of example smp <- ctcData$id %in% sample(1:1000, 200, FALSE) ctcData <- ctcData[smp,] # analysis with both time-dependent and time-independent components res <- ctSFTM(data = ctcData, base = "x", td = "xt") # analysis with only the time-independent component res <- ctSFTM(data = ctcData, base = "x") # analysis with only the time-dependent component res <- ctSFTM(data = ctcData, td = "xt")
Print the primary results of a ctCoxMSM() or ctSFTM() analysis.
## S3 method for class 'ctc' print(x, ...)
## S3 method for class 'ctc' print(x, ...)
x |
An S3 object of class ctc. The value object returned by a call to ctCoxMSM() or ctSFTM(). |
... |
ignored |
No return value, called to display key results.
data(ctcData) # sample data to reduce computation time of example smp <- ctcData$id %in% sample(1:1000, 150, FALSE) ctcData <- ctcData[smp,] # analysis with both time-dependent and time-independent components res <- ctCoxMSM(data = ctcData, base = "x", td = "xt") print(x = res) # analysis with both time-dependent and time-independent components res <- ctSFTM(data = ctcData, base = "x", td = "xt") print(x = res)
data(ctcData) # sample data to reduce computation time of example smp <- ctcData$id %in% sample(1:1000, 150, FALSE) ctcData <- ctcData[smp,] # analysis with both time-dependent and time-independent components res <- ctCoxMSM(data = ctcData, base = "x", td = "xt") print(x = res) # analysis with both time-dependent and time-independent components res <- ctSFTM(data = ctcData, base = "x", td = "xt") print(x = res)