Description Usage Arguments Details
View source: R/main_functions.R
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.
1 2 3 4 5 6 7 8 9 |
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. |
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.