Closed nhejazi closed 1 month ago
Unfortunately, glmnet
implements a limited version of Cox PH regression that is incapable of accommodating time-varying covariates, which appear in the formulation of the penalized Cox model fit on the HAL basis. However, this recent paper describes a new package pcoxtime
providing exactly this functionality.
As of v4.1+, the glmnet
package now provides support for handling time-dependent covariates in the regularized Cox model, see Section "Cox models for start-stop data" of https://cran.r-project.org/web/packages/glmnet/vignettes/Coxnet.pdf for details. This should be useful to allow implementation of the Cox-based conditional density without changing of the glmnet
backend for HAL regression.
The
glmnet
package offers an option of using a penalized version of Cox's proportional hazards model for estimating a conditional hazard function. As the conditional hazard can be re-mapped to a conditional density, and thehal9001
functionfit_hal
may be used as a wrapper forglmnet
, a HAL-based Cox regression for the conditional hazard may be performed. The estimates derived from such a regression procedure could be combined with Nelson-Aalen estimates of the baseline hazard to construct a conditional density estimate.