Learn R Programming

coxphw (version 4.0.3)

plot.coxphw: Plot Weights of Weighted Estimation in Cox Regression

Description

This function plots the weights used in a weighted Cox regression analysis against time.

Usage

# S3 method for coxphw
plot(x, rank = FALSE, log = FALSE, legendxy = NULL,...)

Value

No output value.

Arguments

x

a coxphw object.

rank

if set to TRUE, plots the weights against ranked time. Default is FALSE.

log

if set to TRUE, shows logarithm of weights. Default is FALSE.

legendxy

an optional vector of length 2 of the x and y co-ordinates to be used to position the legend.

...

additional arguments for plotting

Author

Georg Heinze, Daniela Dunkler

Details

The function plots the survival weights, i.e., the left-continuous survivor function estimates, the censoring weights, i.e., estimates of the follow-up distribution obtained by Kaplan-Meier estimation with reversed meaning of the status indicator and the combined normalized weights, i.e. the product of the survival and the censoring weights, rescaled to a mean of 1.

See Also

coxphw

Examples

Run this code
data("gastric")

# weighted estimation of average hazard ratio
fit1 <- coxphw(Surv(time, status) ~ radiation, data = gastric,  template = "AHR")
plot(fit1)

# estimation of average regression effect by inverse probability of censoring weights;
# truncate weights at 95th percentile
fit2 <- coxphw(Surv(time, status) ~ radiation, data = gastric, template = "ARE",
               trunc.weights = 0.95)
plot(fit2)

Run the code above in your browser using DataLab