hazard | R Documentation |
For a given vector of times and a probability distribution function, this function calculates the hazard rate values.
hazard(t, D, P, ...)
t |
a numeric value as time |
D |
a density function |
P |
a cumulative density function |
... |
More parameters |
Hazard rate functions defined as the ratio of the density function and the survival function. That is:
A numeric vector of hazard rate values.
## Standard normal distribution t <- c(0.1, 0.01) P <- pnorm D <- dnorm hazard(t, D, P) ## Uniform distribution with min=2.0 and max=2.5 t <- 2.2 P <- punif D <- dunif hazard(t, D, P, 2.0, 2.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.