sieveSurv: Nonparametrically estimate the survival function using...

Description Usage Arguments Value

View source: R/sieveSurv.R

Description

Nonparametrically estimate the survival function using B-spline sieves

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
sieveSurv(
  time,
  event,
  covar = NULL,
  bspline,
  data,
  logTransform = FALSE,
  tol = 1e-04,
  max_iter = 1000,
  assume_last = FALSE
)

Arguments

time

Column name for follow-up time

event

Column name for event indicators

covar

(Optional) column name(s) for additional fully-observed covariates. Default is covar=NULL, which estimates unconditional survival.

bspline

Column names for B-spline basis.

data

Dataframe or matrix containing (at least) named columns time, event, covar, and bspline.

logTransform

If FALSE, time is log transformed before density estimation. Default is TRUE.

tol

Tolerance to define convergence. Default is tol=1E-4.

max_iter

Maximum number of iterations allowed for the EM algorithm. Default is max_iter = 1000.

assume_last

Assume last observed time is an event (for use when the integration of the survival function is desired). Default is FALSE.

Value

A list with the following five elements:

surv_uncensor

subset of uncensored rows of data with added column surv with survival estimate at their event times

coeff

a matrix of the B-spline coefficients at convergence

od_loglik

value of the observed-data log-likelihood for the B-spline coefficients at convergence

conv

indicator of convergence for the EM algorithn

conv_msg

description of nonconvergence if conv = FALSE


sarahlotspeich/sieveSurv documentation built on Feb. 14, 2022, 5:10 a.m.