hr_helper: Format Simulated Dataset for Hazard Ratio Calculation

View source: R/helper.R

hr_helperR Documentation

Format Simulated Dataset for Hazard Ratio Calculation

Description

This internal function modifies the pooled-over-time dataset generated by the simulate function to a format suitable for hazard ratio calculation.

Usage

hr_helper(i, intcomp, time_name, pools)

Arguments

i

Integer specifying the index intcomp.

intcomp

List of two numbers indicating a pair of interventions to be compared by a hazard ratio.

time_name

Character string specifying the name of the time variable in pools.

pools

Data table containing the simulated values for the covariates, outcome probabilities, competing event probabilities, outcomes, and competing events.

Value

Data table consisting of failure time information for each individual or the last time point information (for individuals who do not experience an event).


gfoRmula documentation built on May 31, 2023, 9:46 p.m.