Relative risks and survival probabilities from a survival fit
Source:R/survival.R
predict.breeding_fit_surv.RdFor each row of newdata, the linear predictor d = x'b + a at that row's levels
is assembled exactly as in the fit. type = "risk" returns exp(d) WITHOUT the
intercept – the relative risk against the baseline, the RRS of the book's tables
(p.291): above 1 is more risk of failure. type = "survival" returns
S(t) = exp(-(lambda t)^rho * exp(d)) (Eqn 16.4), the probability of still being
alive at time – the book's p.292 numbers – with the lambda of the fit, given or
estimated, so the intercept rho * log(lambda) is included (earlier versions left
an ESTIMATED lambda out of S(t)). A reference level contributes zero; a level absent
from the fit's data is an error, not a silent zero. An indirect() term contributes
(n - 1)^(-d) sum_j a_S,j over the pen mates of the row IN newdata: the pen column
must be there (otherwise the prediction is refused), and the mates are the distinct
animals of that pen among the rows of newdata, counted with the static rule
(mates = "all") whatever the fit used.
Arguments
- object
result of
model_survival()- newdata
data.frame with the fixed and random columns of the formula and the pen column of every
indirect()term. The random column may hold any animal of the pedigree (a sire without a record included) – that is how the book computes the percentage of live daughters.- time
survival mode only: the time (one number, or one per row of
newdata) at which to evaluateS(t); numeric, so a factor or text is refused rather than read as its codes (the same holds forentry)- type
"risk"(default) for the relative riskexp(d),"survival"forS(time)- entry
survival mode only: the time (one number, or one per row) the animal is known alive at; the result is then
S(time | entry) = S(time) / S(entry), the survival over the piece(entry, time]of an elementary record. For an animal whose covariates change along its life, the survival to the end is the PRODUCT of this over its pieces (each with its own covariates), which is how the time-dependent model ofmodel_survival(entry =, subject =)reads- ...
unused, kept for the generic