Why are the survival curves different for the Kaplan Meier method and cox regression for the same categorical variable? I have 1 categorical variable called group (1 = treatment, 2 = placebo). If I create the survival curves with the Kaplan Meier method in SPSS I see that the survival is better for the treatment group compared to the placebo group. The survival curves are also significantly different according to the log-rank test.
When I do cox regression with the same variable (without adding other variables) the hazard ratio is significant as well and has a value below 1 (comparing treatment group to placebo group), indicating that the treatment group is associated with decreased hazard. So this is all as expected.
I can also create survival curves during the cox regression in SPSS. I can then seperate the lines for the group variable. However, these survival curves look different than the survival curves of the Kaplan Meier. How is this possible? Also the amount of vertical drops in the curve (which indicates that a patient has died) is also different between the cox regression and kaplan meier survival curves...The amount of vertical drops are somehow similar for the survival curves of the treatment group and placebo group in the cox regression...
Is the interpretation of the survival curves different for the cox regression than for the Kaplan Meier method? Is a vertical drop not a patient that died in cox regression? And how are the survival curves different for the cox regression and kaplan meier when I have the same variable and are comparing the same groups? Is this because the survival probability is calculated in another way?
I hope you can help we further and explain it in an easy way.
Thanks a lot for your help in advance!

As you found, with the situation you describe (a single binary predictor distinguishing 2 groups) the log-rank test for the Kaplan-Meier curves and the score test for the Cox regression will give the same result, as they end up being the same test. There's an important distinction, however, between the Kaplan-Meier and Cox approaches in terms of how survival curves are estimated.
The Kaplan-Meier method estimates the survival curves separately, and empirically, for each group. Thus the 2 curves can have different shapes. In particular, there will be a drop in survival curve for a group only at event times within that group. The depth of each drop will depend on the number of cases still at risk in that group at that time.
The Cox regression model, in contrast, forces the survival curves for the two curves to have the same overall shape, with the hazard ratio constant across all time. The overall hazard ratio is an average over the estimates at all the event times for both groups.
Then with a Cox model, to get the separate survival curves, you start with the overall cumulative baseline hazard over time, estimated by pooling information from both groups. At each event time from either group, in one standard approach you increase the cumulative baseline hazard by the ratio of the number of events at that time to the hazard ratio-weighted number of cases still at risk. If $\Lambda(t)$ is the baseline cumulative hazard over time, then the baseline survival curve is $S(t)=\exp(-\Lambda(t))$.
As the baseline hazard estimated from the Cox model combines information from both groups, the baseline survival curve will have drops at all event times regardless of which group had an event at that time. With 2 groups, the baseline survival curve will be that for the reference group. For the non-reference group, the survival drop at each event time is set to be proportionate to the estimated overall hazard ratio.
Thus you should expect the Kaplan-Meier and Cox-model survival curves to look different in general. Kaplan-Meier curves will have drops only at event times within the corresponding groups, and shapes can differ between groups. Survival curves from Cox models will have drops at all event times regardless of group, and the shapes of the survival curves for the groups are the same. At each event time in an estimate from a Cox model, the relative depth of the drops in the 2 curves will be the same, related to the overall hazard ratio.
