dswah / pyGAM

[HELP REQUESTED] Generalized Additive Models in Python
https://pygam.readthedocs.io
Apache License 2.0
862 stars 159 forks source link

Does pyGAM support conditional logistic regression? #231

Open csaiedu opened 5 years ago

csaiedu commented 5 years ago

In mgcv in R there is support for Conditional Logisitic using coxph with a special data formatting as per below

https://rdrr.io/cran/mgcv/man/coxph.html


## conditional logistic regression models are often estimated using the 
## cox proportional hazards partial likelihood with a strata for each
## case-control group. A dummy vector of times is created (all equal). 
## The following compares to 'clogit' for a simple case. Note that
## the gam log likelihood is not exact if there is more than one case
## per stratum, corresponding to clogit's approximate method.
library(survival);library(mgcv)
infert$dumt <- rep(1,nrow(infert))
mg <- gam(cbind(dumt,stratum) ~ spontaneous + induced, data=infert,
          family=cox.ph,weights=case)

Is it possible to replicate this in pyGAM?

Thanks

dswah commented 5 years ago

@csaiedu no, there is no support for that class of model, yet.

However, it looks like it would be possible to represent e Cox Proportional Hazards model in the GLM framework.

I would like to include such a model in the future.

Sources https://courses.ms.ut.ee/MTMS.01.011/2019_spring/uploads/Main/GLM_slides_13_censored_and_truncated_models.pdf https://www2.eecs.berkeley.edu/Pubs/TechRpts/2017/EECS-2017-110.pdf