Description Usage Arguments Details Value Author(s) Examples
cumhazPlot
uses the cumulative hazard plot to check if a certain distribution
is an appropiate choice for the data.
1 2 3 |
times |
Numeric vector of times until the event of interest. |
cens |
Status indicator (1, exact time; 0, right-censored time). If not provided, all times are assumed to be exact. |
distr |
A string specifying the names of the distributions to be studied.
The possible distributions are the exponential ( |
colour |
Colour of the points. Default colour: black. |
betaLimits |
Two-components vector with the lower and upper bounds of the Beta distribution. This argument is only required, if the beta distribution is considered. |
igumb |
Two-components vector with the initial values for the estimation of the Gumbel distribution parameters. |
ggplo |
Logical to use or not the ggplot2 package to draw the plots.
Default is |
m |
Optional layout for the plots to be displayed. |
prnt |
Logical to indicate if the maximum likelihood estimates of the
parameters of all distributions considered should be printed.
Default is |
decdig |
Number of significant (see |
... |
Optional arguments for function |
The cumulative hazard plot is based on transforming the cumulative hazard function Λ in such a way that it becomes linear in t or \log(t). This transformation is specific for each distribution. The function uses the data to compute the Nelson-Aalen estimator of the cumulative hazard function, \widehat{Λ}, and the maximum likelihood estimators of the parameters of the theoretical distribution under study. If the distribution fits the data, the plot is expected to be a straight line.
The parameter estimation is acomplished with the fitdistcens
function of the fitdistrplus package.
Parameter estimates |
A list with the maximum likelihood estimates of the parameters of all distributions considered. |
K. Langohr, M. Besalú, G. Gómez.
1 2 3 4 5 6 7 8 | # Complete data and default distributions
set.seed(123)
x <- rlogis(1000, 50, 5)
cumhazPlot(x, lwd = 2)
# Censored data comparing three distributions
data(nba)
cumhazPlot(nba$survtime, nba$cens, distr = c("expo", "normal", "gumbel"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.