usual_illness_death_weight: Fit MSM Illness-death Usual Markov Model For Semi-competing...

View source: R/usual_markov_model.R

usual_illness_death_weightR Documentation

Fit MSM Illness-death Usual Markov Model For Semi-competing Risks Data

Description

Fit the marginal structural three-state illness-death model with Cox representation and IP weights for semi-competing risks data. Inference under this model can be carried out using estimating equations with IP weights.

Usage

usual_illness_death_weight(data,X1,X2,event1,event2,w,Trt)

Arguments

data

The dataset, includes non-terminal events, terminal events as well as event indicator.

X1

Time to non-terminal event, could be censored by terminal event or lost to follow up.

X2

Time to terminal event, could be censored by lost to follow up.

event1

Event indicator for non-terminal event.

event2

Event indicator for terminal event.

w

IP weights.

Trt

Treatment variable.

Details

Let T_1, T_2 be the time to non-terminal event and terminal event, A be the treatment assignment. We postulate the semi-parametric Cox models for three transition rates in marginal structural illness-death model:

λ_{1}(t_1 ; a) = λ_{01}(t)e^{β_1 a}, t_1 > 0 ;

λ_{2}(t_2 ; a) = λ_{02}(t)e^{β_2 a}, t_2 > 0 ;

and

λ_{12}(t_2 \mid t_1 ; a) = λ_{03}(t_2)e^{β_3 a}, 0 < t_1 < t_2 .

The coefficients as well as Breslow type baseline hazards can be estimated by fitting the IP weights Cox proportional hazards models. Meanwhile, if we assume the estimated weights as known, then the robust sandwich variance estimator can be used to obtain the estimated variance.

The usual Markov model is also the same as the initial value for the general Markov model.

Value

A list of values and dataframes:

beta1

Estimated β_1, the coefficient for the non-terminal event model.

beta2

Estimated β_2, the coefficient for the terminal event without non-terminal event model.

beta3

Estimated β_3, the coefficient for the terminal event following non-terminal event model.

sd_beta1

Model based standard error for β_1.

sd_beta2

Model based standard error for β_2.

sd_beta3

Model based standard error for β_3.

Lambda01

See also get_hazard. List of two dataframes for estimated Λ_{01} and λ_{01} , the estimated (cumulative) baseline hazard for the non-terminal event model.

Lambda02

List of two dataframes for estimated Λ_{02} and λ_{02} , the estimated (cumulative) baseline hazard for the terminal event without non-terminal event model.

Lambda03

List of two dataframes for estimated Λ_{03} and λ_{03} , the estimated (cumulative) baseline hazard for the terminal event following non-terminal event model.

Examples

n <- 500
set.seed(1234)
Cens = runif(n,0.7,0.9)
set.seed(1234)
OUT1 <- sim_cox_msm_semicmrsk(beta1 = 1,beta2 = 1,beta3 = 0.5,
                              sigma_2 = 1,
                              alpha0 = 0.5, alpha1 = 0.1, alpha2 = -0.1, alpha3 = -0.2,
                              n=n, Cens = Cens)
data_test <- OUT1$data0

## Get the PS weights
vars <- c("Z1","Z2","Z3")
ps1 <- doPS(data = data_test,
            Trt = "A",
            Trt.name = 1,
            VARS. = vars,
            logistic = TRUE,w=NULL)
w <- ps1$Data$ipw_ate_stab

### Fit the Usual Markov model
res1 <- usual_illness_death_weight(data = data_test,
                                   X1 = "X1",
                                   X2 = "X2",
                                   event1 = "delta1",
                                   event2 = "delta2",
                                   w = w,
                                   Trt = "A")
print(paste("The estimated value for beta1 is:", round(res1$beta1,5) ) )


semicmprskcoxmsm documentation built on April 30, 2022, 1:08 a.m.