npsurv: Nonparametric Survival Function Estimation

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/npsurv.R

Description

npsurv computes the nonparametric maximum likelihood esimate (NPMLE) of a survival function for general interval-censored data.

Usage

1
npsurv(data, w = 1, maxit = 100, tol = 1e-06, verb = 0)

Arguments

data

vector or matrix, or an object of class icendata.

w

weights or multiplicities of the observations.

maxit

maximum number of iterations.

tol

tolerance level for stopping the algorithm. It is used as the threshold on the increase of the log-likelihood after each iteration.

verb

verbosity level for printing intermediate results at each iteration.

Details

If data is a vector, it contains only exact observations, with weights given in w.

If data is a matrix with two columns, it contains interval-censored observations, with the two columns storing their left and right end-points, respectively. If the left and right end-points are equal, then the observation is exact. Weights are provided by w.

If data is a matrix with three columns, it contains interval-censored observations, with the first two columns storing their left and right end-points, respectively. The weight of each observation is the third-column value multiplied by the corresponding weight value in w.

The algorithm used for computing the NPMLE is either the constrained Newton method (CNM) (Wang, 2008), or the hierachical constrained Newton method (HCNM) (Wang and Taylor, 2013) when there are a large number of maximal intersection intervals.

Inside the function, it examines if data has only right censoring, and if so, the Kaplan-Meier estimate is computed directly by function km.

An interval-valued observation is either (Li, Ri] if Li < Ri, or [Li, Ri] if Li = Ri.

Value

An object of class npsurv, which is a list with components:

f

NPMLE, an object of class idf.

upper

largest finite value in the data.

convergence

= TRUE, converged successfully;

= FALSE, maximum number of iterations reached.

method

method used internally, either cnm or hcnm.

ll

log-likelihood value of the NPMLE f.

maxgrad

maximum gradient value of the NPMLE f.

numiter

number of iterations used.

Author(s)

Yong Wang <yongwang@auckland.ac.nz>

References

Wang, Y. (2008). Dimension-reduced nonparametric maximum likelihood computation for interval-censored data. Computational Statistics & Data Analysis, 52, 2388-2402.

Wang, Y. and Taylor, S. M. (2013). Efficient computation of nonparametric survival functions via a hierarchical mixture formulation. Statistics and Computing, 23, 713-725.

See Also

icendata, Deltamatrix, idf, km.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## all exact observations
data(acfail)
plot(npsurv(acfail))

## right-censored (and exact) observations
data(gastric)
plot(npsurv(gastric))

data(leukemia)
i = leukemia[,"group"] == "Placebo"
plot(npsurv(leukemia[i,1:2]), xlim=c(0,40), col="blue") # placebo
plot(npsurv(leukemia[!i,1:2]), add=TRUE, col="red")     # 6-MP

## purely interval-censored data
data(ap)
plot(npsurv(ap))

data(cancer)
cancerRT = with(cancer, cancer[group=="RT",1:2])
plot(npsurv(cancerRT), xlim=c(0,60))                  # survival of RT 
cancerRCT = with(cancer, cancer[group=="RCT",1:2])
plot(npsurv(cancerRCT), add=TRUE, col="green")        # survival of RCT 

npsurv documentation built on Oct. 23, 2020, 5:43 p.m.

Related to npsurv in npsurv...