km.pmf: Probability Mass Function for the support of the Kaplan-Meier...

View source: R/km.pmf.R

km.pmfR Documentation

Probability Mass Function for the support of the Kaplan-Meier product-limit estimator

Description

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.

Usage

km.pmf(n, h, perc, plot, sep, xfrac, cex.lollipop)

Arguments

n

sample size

h

probability of observing a failure, in other words, P(X = T)

perc

cumulative probability associated with X = min(T, C)

plot

option to plot the probability mass function (default is TRUE)

sep

option to show the breakdown of the probability for each support value (see function km.outcomes for details on the breakdown) (default is TRUE)

xfrac

option to label support values on the x-axis as exact fractions (default is TRUE)

cex.lollipop

size of the dots atop the spikes

Details

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.

Value

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.

Author(s)

Yuxin Qin (yqin08@wm.edu), Heather Sasinowska (hdsasinowska@wm.edu), Larry Leemis (leemis@math.wm.edu)

References

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.

See Also

survfit

Examples

km.pmf(4, 1/3, 0.75)

km.pmf(8, 1/2, 0.75, sep = FALSE, xfrac = FALSE, cex.lollipop = 0.01)

conf documentation built on Oct. 1, 2023, 1:07 a.m.