npsurv {longevity} | R Documentation |
Nonparametric maximum likelihood estimation for arbitrary truncation
Description
The syntax is reminiscent of the Surv function, with additional vectors for left-truncation and right-truncation.
Usage
npsurv(
time,
time2 = NULL,
event = NULL,
type = c("right", "left", "interval", "interval2"),
ltrunc = NULL,
rtrunc = NULL,
weights = NULL,
arguments = NULL,
...
)
Arguments
time |
excess time of the event of follow-up time, depending on the value of event |
time2 |
ending excess time of the interval for interval censored data only. |
event |
status indicator, normally 0=alive, 1=dead. Other choices are |
type |
character string specifying the type of censoring. Possible values are " |
ltrunc |
lower truncation limit, default to |
rtrunc |
upper truncation limit, default to |
weights |
vector of weights, default to |
arguments |
a named list specifying default arguments of the function that are common to all |
... |
additional arguments passed to the functions |
Value
a list with components
-
xval
: unique ordered values of sets on which the distribution function is defined -
prob
: estimated probability of failure on intervals -
convergence
: logical;TRUE
if the EM algorithm iterated until convergence -
niter
: logical; number of iterations for the EM algorithm -
cdf
: nonparametric maximum likelihood estimator of the distribution function
Note
Contrary to the Kaplan-Meier estimator, the mass is placed in the interval
[max(time), Inf
) so the resulting distribution function is not deficient.
See Also
Examples
#' # Toy example with interval censoring and right censoring
# Two observations: A1: [1,3], A2: 4
# Probability of 0.5
test_simple2 <- npsurv(
time = c(1,4),
time2 = c(3,4),
event = c(3,1),
type = "interval"
)