Surv are allowed similar to survfit.## S3 method for class 'formula':
icfit(formula, data, \dots)
## S3 method for class 'default':
icfit(L, R,initfit =NULL, control=icfitControl(), Lin=NULL, Rin=NULL, ...)Surv when type='interval2', see details)Surv function when type='interval2', see details)icfit or icsurv, or a character vector of the name of the function used to calculate the initial estimate (see details)icfitControl)Surv object
the right side of the formula may be 1 or a factor (which produces separate fits for each level).icfit (same as icsurv class, see details).
There are 4 methods for this class: plot.icfit, print.icfit, summary.icfit, and [.icfit. The last method
pulls out individual fits when the right side of the formula of the icfit call was a factor.
A list with elements:icfit function fits the nonparametric maximum likelihood estimate (NPMLE) of the
distribution function for interval censored data. In the default case (when Lin=Rin=NULL)
we assume there are n (n=length(L)) failure times, and the ith one is in the interval
between L[i] and R[i]. The default is not to include L[i] in the interval unless L[i]=R[i],
and to include R[i] in the interval unless R[i]=Inf. When Lin and Rin are not NULL they describe
whether to include L and R in the associated interval. If either Lin or Rin is length 1 then it is
repeated n times, otherwise they should be logicals of length n.
The algorithm is basically an EM-algorithm applied to
interval censored data (see Turnbull, 1976); however
first we can define a set of intervals (called the Turnbull intervals)
which are the only intervals where the NPMLE may change. The Turnbull intervals are also called the
innermost intervals, and are the result of the primary reduction (see Aragon and
Eberly, 1992). The starting distribution for the E-M algorithm is given by initfit, which may be either
(1) NULL, in which case a very simple and quick starting distribution is used (see code), (2) a character vector
describing a function with inputs, L,R, Lin, Rin, and A, see for example initcomputeMLE, (3)
a list giving pf and intmap values, e.g., an icfit object. If option (2) is tried and results in an error then
the starting distribution reverts to the one used with option (1).
Convergence is defined when the maximum
reduced gradient is less than epsilon (see icfitControl), and the
Kuhn-Tucker conditions are approximately met,
otherwise a warning will result. (see Gentleman and
Geyer, 1994). There are other faster algorithms (for example see
EMICM in the package
Icens.
The output is of class icfit which is identical to the icsurv class of the
Icens package when there is only one group for which a distribution is needed.
Following that class, there is an intmap element which gives the bounds
about which each drop in the NPMLE survival function can occur.
Since the classes icfit and icsurv are so closely related, one can directly
use of initial (and faster) fits from the Icens package as input in
initfit. Note that when using a non-null initfit, the Lin and Rin values of the
initial fit are ignored. Alternatively, one may give the name of the function used to calculate the initial fit.
The function is assumed to input the transpose of the A matrix (called A in the Icens package). Options can be passed
to initfit function as a list using the initfitOpts variable in icfitControl.
The advantage of the icfit function over those in Icens package is that it allows a call similar
to that used in survfit of the survival package so that different groups may be
plotted at the same time with similar calls.
An icfit object prints as a list (see value below). A print function prints output as a list
except suppresses printing of A matrix. A summary function prints the
distribution (i.e., probabilities and the intervals where those
probability masses are known to reside) for each group in the icfit object. There is also
a plot method, see plot.icfit.
For additional references and background see Fay and Shaw (2010).ictest, EMICMdata(bcos)
icout<-icfit(Surv(left,right,type="interval2")~treatment, data=bcos)
plot(icout)
## can pick out just one group
plot(icout[1])Run the code above in your browser using DataLab