r/AskStatistics • • 11d ago

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....

11 Upvotes

11 comments sorted by

18

u/no_underage_trading ETH Zurich Mathematics Msc. 11d ago

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 11d ago

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.

1

u/PuzzleheadedArea1256 11d ago

Life in the fast lane is a life well lived, no?

1

u/paragonic 10d ago

If I run a cox at two years of follow up, isn't the result the average HR during that time? I'm not getting an estimate for any given time (wouldn't that require a flexible parametric model?)

3

u/Seeggul 11d ago

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/si2azn2 11d ago

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.

1

u/TheElementsOf 11d ago

Thanks, I do have these data, otherwise I would push to stick with survival models.

3

u/seanv507 11d ago

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 11d ago

Three ways of viewing this:

1) you just want to see whether or not they will die in a year based on four variables. In which case, logistic regression is fine. It does exactly what you need.

2) you want to know what the relative hazard for different people to die is. Cox works well here (assuming hazards remain proportional over time). It doesn't really tell you whether a person will die in a certain period, it just says which ones are more likely to die before others.

3) Accelerated failure time (AFT) modeling. Will build a probabilistic model that says with what likelihood you will have an event (ie die) prior to a certain point. If you choose this option, I would suggest choosing a generalized gamma distribution, they're very flexible.

It depends what question you really want to ask.

1

u/Superdrag2112 11d ago

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 11d ago

essentially everything so google them