Learn R Programming

JM (version 1.5-2)

piecewiseExp.ph: Proportional Hazards Models with Piecewise Constant Baseline Hazard Function

Description

Based on a fitted Cox model this function fits the corresponding relative risk model with a piecewise constant baseline hazard using the Poisson regression equivalence

Usage

piecewiseExp.ph(coxObject, knots = NULL, length.knots = 6)

Value

an object of class glm.

Arguments

coxObject

an object of class coxph.

knots

A numeric vector denoting the internal knots (cut points) defining the intervals in which the baseline hazard is assumed constant.

length.knots

a numeric value denoting the number of internal knots to use in the fit. Used when knots = NULL.

Author

Dimitris Rizopoulos d.rizopoulos@erasmusmc.nl

References

Rizopoulos, D. (2012) Joint Models for Longitudinal and Time-to-Event Data: with Applications in R. Boca Raton: Chapman and Hall/CRC.

Examples

Run this code
coxFit <- coxph(Surv(Time, death) ~ drug, data = aids.id, x = TRUE)
piecewiseExp.ph(coxFit)

Run the code above in your browser using DataLab