rStats.js v1.3.0
    Preparing search index...

    Function survfit

    • Kaplan-Meier estimate of the survival function with Greenwood's standard error and pointwise confidence intervals. Equivalent to R's survival::survfit(). As summary(survfit(Surv(time, status) ~ group, conf.type, conf.int), censored = TRUE), with the medians and their confidence limits of summary(fit)$table.

      Rows with a missing time, status or group are dropped.

      Parameters

      • time: readonly number[]

        Follow-up times.

      • status: readonly number[]

        1 for an event, 0 for a censored time.

      • options: SurvfitOptions = {}

      Returns SurvfitResult

      survfit([1, 2, 2, 3, 4], [1, 1, 0, 1, 0]).surv; // [0.8, 0.6, 0.3, 0.3]