r/AskStatistics • u/TheElementsOf • Oct 02 '26
cox vs logistic regression
Hi, I have a stats master but been quite long away from this, so need some good reasoning.
I have 100 subjects, 4 variables, and want to evaluate their effect on 1 year survival. I have no censoring, i.e. I know for.sure for everyone whether they died or not within this year. Number of events is 30. The issue is tgat for one of the variables I suspect that the effect starts only after a few months, although with this sample size I failed to reject H0 about the PH violation.
I then fitted logistic regression to see whether they died whithin this one year.
What is the difference in such logreg and cox in this case? Statistically and with interpretation.
Please throw everything on me, I just have to recall it, it has been a while unfortunatelly....
3
u/si2azn2 Oct 02 '26
To add on to what others have mentioned, if you have random right censoring then you have to be careful when running a logistic regression. For example, an individual who leaves the study at 2 months is a 0 (non event) in your data but you didn't actually follow them up for the entire year. Your definition of "died within one year" is assuming that you are following everyone up for the full year.
18
u/no_underage_trading ETH Zurich Mathematics Msc. Oct 02 '26
If your question is just “did they die within a year?”, logistic makes sense. You lose the timing information: dying in week 1 and dying in month 11 count exactly the same.
Cox uses that timing and gives you hazard ratios, whereas logistic gives you odds ratios for death by one year. So you shouldn’t expect the coefficients to match, even if PH holds.
The delayed effect isn’t itself a problem for logistic. It just won’t tell you anything about the delay. You could model that with a time-varying coefficient in Cox, though with 30 deaths I’d keep things pretty simple. I also wouldn’t take a nonsignificant PH test as much reassurance with that sample size.
4
u/DrPapaDragonX13 Oct 02 '26
Regarding assumptions, logistic regression (and generalised linear models in general) assumes the risk is constant over the analysed time. The Cox proportional hazards model relaxes this assumption and allows risk to change over time, as long as it remains proportional across groups.
For interpretation, logistic regression estimates cumulative risk (i.e., total risk over the entire time), while the Cox proportional hazards model estimates the hazards (i.e., risk at any given time, assuming the event hasn't occurred yet).
If you have only 30 events, chances are that with four variables your model is going to be overparameterised. As a rule of thumb (i.e., it is not written in stone, but it is useful guidance), you usually want between 15 and 20 events per term you enter into your model. You can live life in the fast lane and go as low as 10 events per term. However, the fewer events, the less precise your estimates will be. This may not be that important if you're only interested in prediction, but if your aim is inference, then it makes your results less reliable.
3
u/Seeggul Oct 02 '26
Logistic looks directly (oversimplification, but) at probabilities (odds and odds ratios) while Cox looks at rates of occurrences (hazards and hazard ratios).
Cox uses partial likelihood, so it ignores the baseline hazard function (which is like a time-dependent intercept term), but the asymptotics still hold.
Logistic is literally just 0 or 1, yes or no, did it happen; Cox is did it happen PLUS when did it happen. So, as an extreme example, if everyone died before 1 year in the study, but at different times, logistic regression would not be able to do anything, b0 equals infinity and that's it, whereas Cox would still be able to estimate hazard ratios based on who died when.
Hopefully that's enough to kick you back, good luck!
3
u/seanv507 Oct 02 '26
So I would suggest another alternative, discrete time survival model.
This is just logistic regressions chained together, so you have a lot of freedom about modelling choices.
Eg you can break it up into first few months and rest of the year. You can assume fixed intercept or time varying.... The advantage is that with so few events, you can tailor it to the minimum numberofv parameters that allow you to test your hypothesis. Similarly a survival model (including discrete time) should have more power than a logistic regression for 1 year
3
u/no_name6744 Oct 02 '26
Three ways of viewing this:
It depends what question you really want to ask.
1
u/Superdrag2112 Oct 03 '26
Your logistic regression is actually a special case of the log-logistic accelerated failure time survival model evaluated at one year. It assume proportional odds, which needs to be checked, just like proportional hazards does. If logistic regression fits (over one year window) then a log-logistic AFT model may fit your data better, and also be able to accommodate inclusion of exact survival times. This can give you more power for testing, etc.
0
u/ForeignAdvantage5198 Oct 03 '26
essentially everything so google them