residuals
for objects
inheriting from class survreg
.## S3 method for class 'survreg':
residuals(object, type=c("response", "deviance","dfbeta","dfbetas",
"working","ldcase","ldresp","ldshape", "matrix"), rsigma=TRUE,
collapse=FALSE, weighted=FALSE, ...)
survreg
."response"
, "deviance"
,
"dfbeta"
, "dfbetas"
, "working"
, "ldcase"
, "lsresp"
,
"ldshape"
, and "matrix"
. S
The matrix type produces a matrix based on derivatives of the log-likelihood
function. Let $L$ be the log-likelihood, $p$ be the linear predictor $X\beta$,
and $s$ be $\log(\sigma)$. Then the 6 columns of the matrix are
$L$, $dL/dp$,$\partial^2L/\partial p^2$,
$dL/ds$, $\partial^2L/\partial s^2$ and
$\partial^2L/\partial p\partial s$. Diagnostics based on these quantities
are discussed in an article by Escobar and Meeker.
The main ones are the likelihood displacement residuals for perturbation
of a case weight (ldcase
), the response value (ldresp
), and the shape
.
predict.survreg
fit <- survreg(Surv(time,status) ~x, aml)
rr <- residuals(fit, type='matrix')
Run the code above in your browser using DataLab