compute_risk_tb: <Private function> Compute number at risk at each event time...

View source: R/km_type_weights.R

compute_risk_tbR Documentation

<Private function> Compute number at risk at each event time from cohort

Description

<Private function> Compute number at risk at each event time from cohort

Usage

compute_risk_tb(cohort, match_var_names, staggered)

Arguments

cohort

Cohort data prepared by prepare_cohort.

match_var_names

Name(s) of the match variable(s).

staggered

Whether time is staggered (i.e., t_start is specified in input).

Value

Returns a data.frame with the following columns:

t_event

Unique event times in cohort_skeleton.

n_event

Number of events at each event time.

n_at_risk

Number of subjects at risk at each event time.

strata

Strata defined by matching variables. match_var=1 if the NCC is only time-matched.

<each matching variable>

If the NCC is matched on additional confounders, each matching variable will be included as a column to the right of strata.


nyilin/SamplingDesignTools documentation built on Nov. 20, 2022, 8:07 a.m.