Title: | Use IPW to Estimate Treatment Effect under Competing Risks |
---|---|
Description: | Uses inverse probability weighting methods to estimate treatment effect under marginal structure model for the cause-specific hazard of competing risk events. Estimates also the cumulative incidence function (i.e. risk) of the potential outcomes, and provides inference on risk difference and risk ratio. Reference: Kalbfleisch & Prentice (2002)<doi:10.1002/9781118032985>; Hernan et al (2001)<doi:10.1198/016214501753168154>. |
Authors: | Yiran Zhang, Ronghui Xu |
Maintainer: | Yiran Zhang <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.2.1 |
Built: | 2024-11-20 06:52:37 UTC |
Source: | CRAN |
cif_est
estimates the cumulative incidence function (CIF, i.e.risk) based on the cause-specific regression results with 95% confidence intervals, it also calculates the risk ratio and risk difference for the specific time point.
cif_est(data=, time, time2 = NULL, Event.var, Events, cif.event, weight.type, ties = NULL, risktab = TRUE, risk.time = NULL)
cif_est(data=, time, time2 = NULL, Event.var, Events, cif.event, weight.type, ties = NULL, risktab = TRUE, risk.time = NULL)
data |
The dataset, output of |
time |
See |
time2 |
See |
Event.var |
The variable name for the event indicator which typically has at least 3 levels. |
Events |
The vector of all the event name, the rest of levels in the |
cif.event |
Value of event of interest for the CIF. |
weight.type |
See |
ties |
See |
risktab |
Indicator whether the risk ratio and risk difference table should be returned. |
risk.time |
If |
After estimating the parameters in the cause-specific hazard using IPW, we could estimate the corresponding CIF:
where is the estimated overall survial function for
,
,
, and
is a Breslow-type estimator of the baseline cumulative hazard.
Returns a table containing the estimated CIF for the event of interest for control and treated group and their 95% confidence intervals.
If risktab
, will return the risk ratio and risk difference at time risk.time
, and their 95% confidence intervals.
Hou, J., Paravati, A., Hou, J., Xu, R., & Murphy, J. (2018). “High-dimensional variable selection and prediction under competing risks with application to SEER-Medicare linked data,” Statistics in Medicine 37(24), 3486-3502.
doPS
calculates the unstabilized and stabilized inverse probability treatment weights (IPW) for average treatment effect using propensity score. The propensity score is calculated by twang
package using the boosted logistic regression.
doPS(data,Trt,Trt.name,VARS.)
doPS(data,Trt,Trt.name,VARS.)
data |
The dataset, includes treatment assignment as well as covariates |
Trt |
The name of the treatment variable in the dataset. |
Trt.name |
The treated group name of the treatment variable in the dataset. |
VARS. |
The vector of the name of potential confounding variables in the dataset. |
The treatment variable should only contain 2 levels of treatment, and one should be viewed as treated group and another is control group.
For stabilized weights:
For the treated individuals, we assign the IPW: w = Pr(T=1)/Pr(T=1|X=x), for control individuals, the stabilized weight is: w = (1-Pr(T=1))/(1-Pr(T=1|X=x)).
doPS returns an object of class "PS". An object of class "PS" is a list containing the following components:
Data |
A new dataset which excludes all the missing value on the potential confounders from input data, add the propensity score and IPW into the new dataset.
|
ps |
an object of class |
Competing risk data set involving follicular cell lymphoma from Pintilie (2007)
data(follic)
data(follic)
A data frame containing:
age
age
hgb
hemoglobin (g/l)
clinstg
clinical stage: 1=stage I, 2=stage II
ch
chemotherapy
rt
radiotherapy
time
first failure time
status
Reason of failure: 1: Relapse, 2: Death, 0: No response
Pintilie M., (2006) Competing Risks: A Practical Perspective. West Sussex: John Wiley and Sons.
This function produces a CIF plots for cif_est
objects.
plot_est_cif(cif.data, color = color, ci.cif = FALSE)
plot_est_cif(cif.data, color = color, ci.cif = FALSE)
cif.data |
The dataset, output of |
color |
Color for control and treatment group, has to be a vector of length 2. |
ci.cif |
Indicator whether to plot the 95% confidence interval area for the CIF. |
A cumulative incidence function plot (with 95% confidence interval area) corresponding to the output from cif_est
.
Displays a the histogram plots for the propensity score, stratified by treated and control group and a graph of standardized mean difference of potential confounders before and after weigthing.
## S3 method for class 'PS' plot(x,...)
## S3 method for class 'PS' plot(x,...)
x |
The results of |
... |
the other arguments you want to put in the built-in plot function |
The standardized mean difference (SMD), defined as the (weighted) treatment group mean minus the (weighted) control group mean divided by the (weighted) pooled sample (treatment and control) standard deviation. SMD between -0.1 and 0.1 typically indicates good balance.
Histogram of propensity score and balancing plot for covariates in the propensity score model corresponding to the output from doPS
.
Formats p-values for reports, can report adjusted pvalues
pvalFormat(p.values, method = 'none', replace = FALSE)
pvalFormat(p.values, method = 'none', replace = FALSE)
p.values |
p-value |
method |
pvalue adjustment, passed to p.adjust.methods |
replace |
if TRUE, replaces p-values with their adjusted value |
Return the formatted p-value: round the p-value, assign the significance sign to the p-value based on the significant level. Can be used directly to the LaTex report.
p <- 0.002354 print(p.1 <- pvalFormat(p))
p <- 0.002354 print(p.1 <- pvalFormat(p))
weight_cause_cox
fits the marginal structural proportional cause-specific hazards model using the inverse probability treatment weights.
weight_cause_cox(data=, time, time2 = NULL, Event.var, Event, weight.type, ties = NULL)
weight_cause_cox(data=, time, time2 = NULL, Event.var, Event, weight.type, ties = NULL)
data |
The dataset, output of |
time |
See also |
time2 |
See also |
Event.var |
The variable name for the event indicator which typically has at least 3 levels. |
Event |
Event of interest, the rest of the event are treating as competing event. |
weight.type |
Type of inverse probability weights. Possible values are "Unstabilized" and "Stabilized". |
ties |
See also |
The marginal structural cause-specific Cox model for cause j usually has the form:
where ,
is the counterfactural survival time and cause for treatment
,
is the unspecified baseline cause-specific hazard for cause j, and
is the treatment effect.
Returns a table containing the estimated coefficient of the treatment effect, the robust standard error of the coefficient, estimated hazard ratio and 95% CI for the hazard ratio.