Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

km.mrl

Mean Residual Life using Kaplan-Meier estimate


Description

This function computes the mean residual life for censored data using the Kaplan-Meier estimate of the survival function. If S(t) is the K-M estimate, the MRL for a censored observation is computed as (\int_t^{∞} S(u)du)/S(t). We take S(t)=0 when t is greater than the largest observation, regardless of whether that observation was censored.

When there are ties between censored and uncensored observations, for definiteness our ordering places the censored observations before uncensored.

This function is used by locfit.censor to compute censored regression estimates.

Usage

km.mrl(times, cens)

Arguments

times

Obsereved survival times.

cens

Logical variable indicating censoring. The coding is 1 or TRUE for censored; 0 or FALSE for uncensored.

Value

A vector of the estimated mean residual life. For uncensored observations, the corresponding estimate is 0.

References

Buckley, J. and James, I. (1979). Linear Regression with censored data. Biometrika 66, 429-436.

Loader, C. (1999). Local Regression and Likelihood. Springer, NY (Section 7.2).

See Also

Examples

# censored regression using the Kaplan-Meier estimate.
data(heart, package="locfit")
fit <- locfit.censor(log10(surv+0.5)~age, cens=cens, data=heart, km=TRUE)
plotbyfactor(heart$age, 0.5+heart$surv, heart$cens, ylim=c(0.5,16000), log="y")
lines(fit, tr=function(x)10^x)

locfit

Local Regression, Likelihood and Density Estimation

v1.5-9.4
GPL (>= 2)
Authors
Catherine Loader [aut], Jiayang Sun [ctb], Lucent Technologies [cph], Andy Liaw [cre]
Initial release
2020-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.