dot-calc_surv: Helper function for 'calc_cuminc_df'

.calc_survR Documentation

Helper function for calc_cuminc_df

Description

Just a helper function to make things a little cleaner and easier in the function calc_cuminc_df.

Usage

.calc_surv(data, time, event, type = "right", extend = FALSE)

Arguments

data

A data frame or tibble

time

Vector of integer event times. For right censored data, this is the follow up time. For interval data, the first argument is the starting time for the interval.

event

The status indicator, normally 0=alive, 1=dead. Other choices are TRUE/FALSE (TRUE = death) or 1/2 (2=death). For interval censored data, the status indicator is 0=right censored, 1=event at time, 2=left censored, 3=interval censored. For multiple enpoint data the event variable will be a factor, whose first level is treated as censoring. Although unusual, the event indicator can be omitted, in which case all subjects are assumed to have an event.

type

character string specifying the type of censoring. Possible values are "right", "left", "counting", "interval", "interval2" or "mstate".

extend

logical value: if TRUE, prints information for all specified times, even if there are no subjects left at the end of the specified times. This is only valid if the times argument is present.

Value

A tibble


emilelatour/lamisc documentation built on April 9, 2024, 10:33 a.m.