resid.multiRec: Residuals from a fitted model

View source: R/residuals.R

resid.multiRecR Documentation

Residuals from a fitted model

Description

This returns analogs of martingale residuals, as a matrix with one column for each hazard.

Usage

## S3 method for class 'multiRec'
resid(object, ..., type = c("martingale", "score"))

Arguments

object

an object of type multiRec

...

not used

type

character, the type of residuals. The default is "martingale" for an analog of martingale residuals in coxph. Specifying "score" retrieves a matrix score components (see details).

Details

This function returns a matrix with one row for each observation (i.e. interval) in the input data= dataset, and one column for each hazard model in the call to multiRec().

For each hazard model, the martingale-like residuals are defined as the difference delta.i-cumHaz.i where delta.i is an indicator for whether the corresponding event occurred and cumHaz.i is the estimate of the event specific cumulative hazard.

For each hazard model, the score residual is the component of the score vector.

Value

a numeric matrix with one row per interval and one column per hazard


multiRec documentation built on Feb. 3, 2026, 5:06 p.m.