| plotdistcens {fitdistrplus} | R Documentation |
Plots an empirical distribution for censored data with a theoretical one if specified.
plotdistcens(censdata, distr, para, leftNA = -Inf, rightNA = Inf,
Turnbull = TRUE, Turnbull.confint = FALSE, ...)
censdata |
A dataframe of two columns respectively named |
distr |
A character string |
para |
A named list giving the parameters of the named distribution. This argument may be
omitted only if |
leftNA |
the real value of the left bound of left censored observations : |
rightNA |
the real value of the right bound of right censored observations : |
Turnbull |
if TRUE the Turnbull algorithm is used to estimate the cdf curve of the censored data
and previous arguments |
Turnbull.confint |
if TRUE confidence intervals will be added to the Turnbull plot. |
... |
further graphical arguments passed to other methods |
Empirical and, if specified, theoretical distributions are plotted
in cdf.
If Turnbull is TRUE, the EM approach of Turnbull (Turnbull, 1974)
is used to compute the overall
empirical cdf curve, with confidence intervals if Turnbull.confint is TRUE,
by calls to functions survfit and plot.survfit from the
survival package.
Else data are reported directly as segments for interval, left and right censored data,
and as points for non-censored data. Before plotting, observations are ordered and a rank r
is associated to each of them. Left censored observations are ordered
first, by their right bounds. Interval censored and non censored observations
are then ordered by their mid-points and, at last, right censored observations are
ordered by their left bounds. If leftNA (resp. rightNA) is finite,
left censored (resp. right censored) observations are considered as interval censored
observations and ordered by mid-points with non-censored and interval censored data.
It is sometimes necessary to fix rightNA or leftNA to a realistic
extreme value, even if not exactly known, to obtain a reasonable global ranking of
observations. After ranking, each of the n observations is plotted as a point (one x-value)
or a segment (an interval of possible x-values),
with an y-value equal to r/n, r being the rank of each observation in the global ordering
previously described. This second method may be interesting but
is certainly less rigorous than the Turnbull method
that should be prefered.
Marie-Laure Delignette-Muller and Christophe Dutang.
Turnbull BW (1974), Nonparametric estimation of a survivorship function with doubly censored data. Journal of American Statistical Association, 69, 169-173.
Delignette-Muller ML and Dutang C (2015), fitdistrplus: An R Package for Fitting Distributions. Journal of Statistical Software, 64(4), 1-34.
# (1) Plot of an empirical censored distribution (censored data) as a CDF # using the default Turnbull method # data(smokedfish) d1 <- as.data.frame(log10(smokedfish)) plotdistcens(d1) # (2) Add the CDF of a normal distribution # plotdistcens(d1,"norm",para=list(mean=-1.6,sd=1.5)) # (3) Various plots of the same empirical distribution # # default Turnbull plot plotdistcens(d1,Turnbull = TRUE) # Turnbull plot with confidence intervals plotdistcens(d1,Turnbull = TRUE,Turnbull.confint = TRUE) # with intervals and points plotdistcens(d1,rightNA=3, Turnbull = FALSE) # with intervals and points # defining a minimum value for left censored values plotdistcens(d1,leftNA=-3, Turnbull = FALSE)