Learn R Programming

CPHshape (version 1.0.1)

find.H: Calculate the cumulative hazard function

Description

This function calculates the cumulative hazard function at location t based on input from either find.shapeCPH or find.shapeMLE.

Usage

find.H(t, h.val, h.ranges)

Arguments

t
time at which to evaluate the cumulative hazard (must be univariate)
h.val
vector specifying changes of values in the hazard baseline MLE (output from e.g. find.shapeCPH)
h.ranges
vector specifying locations of changes in values in the hazard baseline MLE (output from e.g. find.shapeCPH)

Value

See Also

find.shapeCPH find.shapeMLE

Examples

Run this code
# random sample from the uniform density
n	<-	500
x	<-	runif(n)

# compute MLE of increasing hazard
mle	<-	find.shapeMLE(x, type="increasing")

# find fitted cumulative hazard function at t=0.2
find.H(0.2, mle$h.val, mle$h.range)

Run the code above in your browser using DataLab