Learn R Programming

eha (version 1.2-18)

check.dist: Graphical goodness-of-fit test

Description

Comparison of the cumulative hazards functions for a semi-parametric and a parametric model.

Usage

check.dist(sp, pp, new.data = sp$means, main = NULL)

Arguments

sp
An object of type "cotxreg", typically output from coxreg
pp
An object of type "phreg", typically output from phreg
new.data
At what covariate values should the baseline hazards for the coxreg model be calculated?
main
Header for the plot. Default is distribution and "cumulativa hazard function"

Value

  • No return value.

Details

For the moment only a graphical comparison.

References

~put references to the literature/web site here ~

See Also

coxreg and phreg.

Examples

Run this code
data(male.mortality)
oldpar <- par(mfrow = c(2, 2))
fit.cr <- coxreg(Surv(enter, exit, event) ~ ses, data = male.mortality)
fit.w <- phreg(Surv(enter, exit, event) ~ ses, data = male.mortality)
fit.g <- phreg(Surv(enter, exit, event) ~ ses, data = male.mortality,
dist = "gompertz")
fit.ln <- phreg(Surv(enter, exit, event) ~ ses, data = male.mortality,
dist = "lognormal")
fit.ev <- phreg(Surv(enter, exit, event) ~ ses, data = male.mortality,
dist = "ev")
check.dist(fit.cr, fit.w)
check.dist(fit.cr, fit.g)
check.dist(fit.cr, fit.ln)
check.dist(fit.cr, fit.ev)
par(oldpar)

Run the code above in your browser using DataLab