smoothTB: Nonparametric Estimation of a Smoothed Turnbull 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 Turnbull (1976) 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
smoothTB(
  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 left and right interval bounds.

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 the left interval bounds, i.e. the last time which the subject was observed to be event-free, with possible NA if a subject is left-censored. Similarly, the second column are the right interval bounds, i.e. the first time which the subject was observed to have experienced an event, with possible NA if a subject is right-censored.

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


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