make_tab_survival: Add column .time

View source: R/prepare_tab.R

make_tab_survivalR Documentation

Add column .time

Description

Adds the column .time, which is the follow-up time

Usage

make_tab_survival(
  tab,
  vardep,
  passage = 1,
  typeCensure = 2,
  dateInclusion = NULL,
  dateSortie = NULL,
  var_time = NULL,
  limit = NULL
)

Arguments

tab

The data frame

vardep

The dependent variable

passage

If 1, The first level of the event variable is the absence of event; if 2, the second level is the absence of event

typeCensure

If 1: Follow-up time computed from 2 dates: inclusion and censor; \ If 2: the follow-up time is already inside a column

dateInclusion

Date vector of length equals to the number of rows of tab: inclusion date.

dateSortie

Date vector of length equals to the number of rows of tab: censor or event.

var_time

Name of the column indicating the follow-up time follow-up

Details

This function requires either var_time or dateSortie and dateInclusion

Value

A table with .time column


KZARCA/simplestats documentation built on Feb. 19, 2024, 1:11 a.m.