I have read STDHA and the documentation for the coxph() function in R. I understand that the cox PH model explores how different covariates simultaneously impact survival. Based on the Lung data example in STDHA, a covariate can seem significantly influential in univariate analysis, but not in multivariate analysis. Following the lung data example, "age" is no longer significant in the multivariate cox model. Quite literally, this means that age does not impact survival when you account for sex and ph.ecog. However, how does the cox PH model evaluate and decide this? Under the hood, does the cox ph model stratify groups by sex, then evaluate if age is still impactful on survival (and then repeat for ph.ecog)? My intuition says no, because I don't think you can do that with continuous variables (so, in turn, how would the model stratify by age and then test if sex still impacts survival)? I don't need a deeply mathematical explanation, as I'm just a coder!
Ultimately, I want to understand if I can run coxph() on the female and male group separately, or if these results would be redundant since we have already added "sex" as a covariate when analyzing all patients.
This is a conceptual question, but please let me know if I can provide any code. If it means anything, I am using surv & survminer in R.