Using the R terminology (but this is software independent statistical problem), is survfit(surv_object ~ rx, data = ovarian)
returning 2 Kaplan-Meier curves the same as doing Cox with the same formula or is this more doing the Cox with using rx for stratification?
In other words, does the Kaplan-Meier assume same baseline risk in both groups (thus it's not stratification)?
My goal:
I have two categorical variables. A = {a1, b1}, B = {b1, b2}
I have two KM plots for the A (giving me 2 coloured curves {a1 and a2}) each per level of the B. I use the ggplot2, so the A is used for colours (... col =A)
and B is used in facet_wrap(~B)
.
And now I want to calculate HR between the a1 and a2 per each level of B, I mean: HR_b1, HR_b2
I can do this using Cox. Should I type something: surv_object ~ A + B
, surv_object ~ A * B
or surv_object ~ A + strata(B)
?