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

sm.survival

Nonparametric regression with survival data.


Description

This function creates a smooth, nonparametric estimate of the quantile of the distribution of survival data as a function of a single covariate. A weighted product-limit estimate of the survivor function is obtained by smoothing across the covariate scale. A small amount of smoothing is then also applied across the survival time scale in order to achieve a smooth estimate of the quantile.

Usage

sm.survival(x, y, status, h , hv = 0.05, p = 0.5, status.code = 1, ...)

Arguments

x

a vector of covariate values.

y

a vector of survival times.

status

an indicator of a complete survival time or a censored value. The value of status.code defines a complete survival time.

h

the smoothing parameter applied to the covariate scale. A normal kernel function is used and h is its standard deviation.

hv

a smoothing parameter applied to the weighted to the product-limit estimate derived from the smoothing procedure in the covariate scale. This ensures that a smooth estimate is obtained.

p

the quantile to be estimated at each covariate value.

status.code

the value of status which defines a complete survival time.

...

other optional parameters are passed to the sm.options function, through a mechanism which limits their effect only to this call of the function; those relevant for this function are add, eval.points, ngrid, display, xlab, ylab, lty; see the documentation of sm.options for their description.

Details

see Section 3.5 of the reference below.

Value

a list containing the values of the estimate at the evaluation points and the values of the smoothing parameters for the covariate and survival time scales.

Side Effects

a plot on the current graphical device is produced, unless the option display="none" is set.

References

Bowman, A.W. and Azzalini, A. (1997). Applied Smoothing Techniques for Data Analysis: the Kernel Approach with S-Plus Illustrations. Oxford University Press, Oxford.

See Also

Examples

x <- runif(50, 0, 10)
y <- rexp(50, 2)
z <- rexp(50, 1)
status <- rep(1, 50)
status[z<y] <- 0
y <- pmin(z, y)
sm.survival(x, y, status, h=2)

sm

Smoothing Methods for Nonparametric Regression and Density Estimation

v2.2-5.6
GPL (>= 2)
Authors
Adrian Bowman and Adelchi Azzalini. Ported to R by B. D. Ripley <ripley@stats.ox.ac.uk> up to version 2.0, version 2.1 by Adrian Bowman and Adelchi Azzalini, version 2.2 by Adrian Bowman.
Initial release
2018-09-27

We don't support your browser anymore

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