Open XiangdongGu opened 3 years ago
PH test can be achieved by adding interaction term with time, see book section 4.4.3 in book Modelling Survival Data in Medical Research by David Collett. Likelihood ratio test can be used to test the interaction term to infer whether the PH assumption is violated or not.
simdata3 <- datasim(N = 1000, blambda = 0.05, testtimes = 1:8,
sensitivity = 0.7, specificity = 0.98, betas = c(0.5, 0.8, 1.0),
twogroup = NULL, pmiss = 0.3, design = "MCAR", negpred = 1)
fit3 <- icmis(subject = ID, testtime = testtime, result = result,
data = simdata3, sensitivity = 0.7, specificity= 0.98,
formula = ~cov1+cov2+cov3, negpred = 1)
fit3int <- icmis(subject = ID, testtime = testtime, result = result,
data = simdata3, sensitivity = 0.7, specificity= 0.98,
formula = ~(cov1+cov2+cov3)*testtime - testtime, negpred = 1)
test_stat <- 2 * (fit3int$loglik - fit3$loglik)
pvalue <- pchisq(test_stat, 3, lower.tail=FALSE)
pvalue
Test PH assumptions by adding interaction terms between time and covariates. See how it is achieved in other models like Cox models.