Cox proportional hazards model function for hazards, partial likelihood and baseline curves
c(time, status, x) = (beta_hat, SE_beta, H_0(t), S_0(t))
Maps right-censored survival records with covariates to the coefficients of the Cox model, their standard errors and the estimated baseline curve. HE-FM-CPH-001 gives the hazard and survival of one covariate profile from a baseline and a linear predictor, HE-FM-CPH-002 the partial likelihood over the risk sets, HE-FM-CPH-003 one step of the Breslow baseline cumulative hazard, HE-FM-CPH-004 the Breslow and Efron terms for two tied deaths, and HE-FM-CPH-005 a hazard ratio that changes with log time. HE-CF-CPH-001 maximises the partial likelihood by Newton-Raphson. HE-FM-HR-002 turns a coefficient into a hazard ratio, HE-FM-HR-006 gives its confidence interval, HE-FN-CUMH-001 links a cumulative hazard to survival and HE-FM-HR-003 is the power rule for a survival curve, and none of these is restated here as a formula of its own. Notation follows the Cox Proportional Hazards article.
Hazard and survival of one covariate profile from a Cox baseline and linear predictor
lp = beta_1 * x_1 + beta_2 * x_2; RS = exp(lp); h_x = h_0 * RS; S_x = S_0^RS
Cox partial likelihood over three event times with a binary covariate
r = exp(beta); p_1 = r^x_1 / (n0_1 + n1_1 * r); p_2 = r^x_2 / (n0_2 + n1_2 * r); p_3 = r^x_3 / (n0_3 + n1_3 * r); L = p_1 * p_2 * p_3; logL = log(L)
Breslow baseline cumulative hazard step and survival of both arms at one Cox event time
r = exp(beta); dH = d / (n0 + n1 * r); H = H_prev + dH; S_0 = exp(-H); S_1 = S_0^r
Breslow and Efron partial likelihood terms and hazard increments for two tied Cox deaths
R_2 = R_s - 0.5 * (s_1 + s_2); P_B = s_1 * s_2 / R_s^2; P_E = s_1 * s_2 / (R_s * R_2); dH_B = 2 / R_s; dH_E = 1 / R_s + 1 / R_2
Cox hazard ratio that changes with log time through a covariate interaction
beta_t = b_0 + b_1 * log(t); HR_t = exp(beta_t)
