rpsftm.coxph.Rd
This function fits a cox model to an rpsftm object. It estimates a hazard ratio for the comparison of experimental observed time compared to control latent time. In addition the variance of the treatment coefficient is inflated based on the test used in g-estimation. Any strata included in rpsftm call are used in the cox model.
rpsftm.coxph(x)
rpsftm object (rpsftm)
# use data included in rpsftm package
library(rpsftm)
immdef <- rpsftm::immdef
immdef$rx <- with(immdef, 1 - xoyrs/progyrs)
# fit the model
imm.fit <- rpsftm(Surv(progyrs, prog) ~ rand(imm, rx),
data=immdef,
censor_time=censyrs)
rpsftm.coxph(imm.fit)
#> Call:
#> coxph(formula = rpsftm.formula(x), data = cfact.df)
#>
#> coef exp(coef) se(coef) z p
#> .arm -0.2633 0.7685 0.1376 -1.914 0.0556
#>
#> Likelihood ratio test=4.72 on 1 df, p=0.02989
#> n= 1000, number of events= 285