| score_cox | R Documentation |
Gradient of the Cox partial log-likelihood with respect to
\boldsymbol{\beta}. Data must be sorted by ascending event time.
score_cox(X, eta, status, y = NULL, weights = 1)
X |
Design matrix (N x p), sorted by ascending event time. |
eta |
Linear predictor vector |
status |
Event indicator (1 = event, 0 = censored). |
y |
Optional numeric vector of observed event/censor times, same length
and order as |
weights |
Observation weights (default 1). |
Under the Breslow approximation, the score is
\mathbf{u} =
\sum_g \Bigl[\sum_{i \in D_g} w_i \mathbf{x}_i -
d_g^{(w)} \frac{\sum_{j \in R_g} w_j e^{\eta_j}\mathbf{x}_j}
{\sum_{j \in R_g} w_j e^{\eta_j}}\Bigr]
where D_g is the tied event set at time t_g,
R_g = \{j : t_j \ge t_g\} is the risk set, and
d_g^{(w)} = \sum_{i \in D_g} w_i.
Numeric column vector of length p (gradient).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.