km.support {conf} | R Documentation |
Support values for the Kaplan-Meier product-limit estimator
Description
Calculate the support values for the Kaplan-Meier product-limit
estimator for a particular sample size n
using an induction
algorithm.
Usage
km.support(n)
Arguments
n |
sample size |
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.support
function calculates the support values for the
Kaplan-Meier product-limit estimator for a sample of
size n
using an induction algorithm
described in Qin et al. (2023).
The n
argument must be a positive integer denoting
the sample size. Allowable limits are from 1 to 35.
Larger values of n
are not allowed because of CPU
and memory limitations.
The numerators and denominators are temporarily converted to
complex numbers within the km.support
function in order to
eliminate duplicate support values using the unique
function.
Value
The km.support
function returns a list with two components.
-
num
: a vector of integers containing the numerators of the support values -
den
: a vector of integers containing the associated denominators of the support values
The support values are not returned in sorted order. Zero and one, which are always a part of the support, are given as 0 / 1 and 1 / 1.
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
Examples
# display unsorted numerators and denominators of support values for n = 4
km.support(4)
# display sorted support values for n = 4 as exact fractions
n <- 4
s <- km.support(n)
i <- order(s$num / s$den)
m <- length(s$num)
f <- ""
for (j in i[2:(m - 1)]) f <- paste(f, s$num[j], "/", s$den[j], ", ", sep = "")
cat(paste("The ", m, " support values for n = ", n, " are: 0, ", f, "1.\n", sep = ""))
# print sorted support values for n = 4 as numerics
print(s$num[i] / s$den[i])