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

Pch

The Piecewise Constant Hazards distribution.


Description

Density, distribution function, quantile function, hazard function, cumulative hazard function, mean, and random generation for the Piecewice Constant Hazards (pch) distribution.

Usage

ppch(q, cuts, levels, lower.tail = TRUE, log.p = FALSE)
dpch(x, cuts, levels, log = FALSE)
hpch(x, cuts, levels, log = FALSE)
Hpch(x, cuts, levels, log.p = FALSE)
qpch(p, cuts, levels, lower.tail = TRUE, log.p = FALSE)
mpch(cuts, levels)
rpch(n, cuts, levels)

Arguments

cuts

Vector of cut points defining the intervals where the hazard function is constant.

levels

Vector of levels (values of the hazard function).

lower.tail

logical; if TRUE (default), probabilities are P(X <= x), otherwise, P(X > x).

x, q

vector of quantiles.

p

vector of probabilities.

log, log.p

logical; if TRUE, probabilities p are given as log(p).

n

number of observations. If length(n) > 1, the length is taken to be the number required.

Details

The pch distribution has a hazard function that is piecewise constant on intervals defined by cutpoints

0 < c_1 < ... < c_n < ∞, n ≥ 0

If n = 0, this reduces to an exponential distribution.

Value

dpch gives the density, ppch gives the distribution function, qpch gives the quantile function, hpch gives the hazard function, Hpch gives the cumulative hazard function, mpch gives the mean, and rpch generates random deviates.

Note

the parameter levels must have length at least 1, and the number of cut points must be one less than the number of levels.


eha

Event History Analysis

v2.10.0
GPL (>= 2)
Authors
Göran Broström [aut, cre], Jianming Jin [ctb]
Initial release
2022-04-17

We don't support your browser anymore

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