smoothKM: Nonparametric Estimation of a Smoothed Kaplan-Meier Survival...

Description Usage Arguments Details

View source: R/main_functions.R

Description

This function estimates survival curves (and time-to-event curves) from interval censored data using the method of Kaplan & Meier (1958) and subsequently finds an optimal smoothing bandwidth which minimizes the a penalized log-likelihood function (sBIC) as described in our manuscript.

Usage

1
2
3
4
5
6
7
8
9
smoothKM(
  dat,
  n.obs = 2,
  left.bound = 0,
  penalty = "logNe",
  n.dec = 2,
  tolerance = NA,
  inflection.threshold = 0.01
)

Arguments

dat

A data.frame or matrix where rows are subjects and columns are the event/censoring time and event indicator.

n.obs

The number of observations per subject. Used for calculation of effective N. Defaults to 2.

left.bound

The earliest possible time which an event can occur. Defaults to 0.

penalty

The penalty/penalties to use when calculating the sBIC. Possible values are "logNe", "logNm", or "logN". Default is "logNe".

n.dec

The number of decimal places in the observed data.

tolerance

The tolerance for change in bandwidth when performing local optimization of the sBIC.

inflection.threshold

Threshold used when counting the number of turning points in the time to event density curve. Note that deviations from the default value have not been extensively tested.

Details

The function takes a matrix or data frame as input, where each row represents a subject. The first column should be either the time at event or the time at last follow up (if the subject is right-censored). The second column is a binary variable indicating whether the subject was observed to experience an event (1) or not (0).

The output is a list containing the original and smoothed Kaplan-Meier survival and time-to-event distributions among other sample and algorithm characteristics.


tubbsjd/SISE documentation built on Dec. 23, 2021, 1:01 p.m.