Generates the probability mass function for the support values
of the Kaplan-Meier product-limit estimator for a particular sample
size n
, probability of observing a failure h
at the time of interest expressed as the cumulative probability perc
associated with X = min(T, C)
, where T
is the failure time and C
is the censoring time under a random-censoring scheme.
km.pmf(n, h, perc, plot, sep, xfrac, cex.lollipop)
The km.pmf
function returns a dataframe with
2 columns. The column named S
stores all the support
values for the Kaplan-Meier product-limit estimator
with sample size n
, including NA
. The
column named P
stores the associated probabilities.
sample size
probability of observing a failure, in other words, P(X = T)
cumulative probability associated with X = min(T, C)
option to plot the probability mass function (default is TRUE
)
option to show the breakdown of the probability for each support value (see function km.outcomes
for details on the breakdown) (default is TRUE
)
option to label support values on the x-axis as exact fractions (default is TRUE
)
size of the dots atop the spikes
Yuxin Qin (yqin08@wm.edu), Heather Sasinowska (hdsasinowska@wm.edu), Larry Leemis (leemis@math.wm.edu)
The Kaplan-Meier product-limit estimator is used to
estimate the survivor function for a data set of
positive values in the presence of right censoring.
The km.pmf
function generates the probability mass function for the support values
of the Kaplan-Meier product-limit estimator for a particular sample
size n
, probability of observing a failure h
at the time of interest expressed as the cumulative probability perc
associated with X = min(T, C)
, where T
is the failure time and C
is the censoring time under a random-censoring scheme.
The n
argument must be a positive integer denoting
the sample size. Allowable limits are from 1 to 23.
Larger values of n
are not allowed because of CPU
and memory limitations.
For larger sample size n
, it is recommended to set
sep = FALSE
, xfrac = FALSE
, and
cex.lollipop = 0.01
for a better visual effect.
Qin, Y., Sasinowska, H., Leemis, L. (2023), "The Probability Mass Function of the Kaplan-Meier Product-Limit Estimator", \(The American Statistician\), Volume 77, Number 1, 102-110.
survfit
km.pmf(4, 1/3, 0.75)
km.pmf(8, 1/2, 0.75, sep = FALSE, xfrac = FALSE, cex.lollipop = 0.01)
Run the code above in your browser using DataLab