format_long_hazards {haldensify} | R Documentation |
Generate Augmented (Long Format) Data for Pooled Hazards Regression
Description
Generate Augmented (Long Format) Data for Pooled Hazards Regression
Usage
format_long_hazards(
A,
W,
wts = rep(1, length(A)),
grid_type = c("equal_range", "equal_mass"),
n_bins = NULL,
breaks = NULL
)
Arguments
A |
The |
W |
A |
wts |
A |
grid_type |
A |
n_bins |
Only used if |
breaks |
A |
Details
Generates an augmented (long format, or repeated measures) dataset that includes multiple records for each observation, a single record for each discretized bin up to and including the bin in which a given observed value of A falls. Such bins are derived from selecting break points over the support of A. This repeated measures dataset is suitable for estimating the hazard of failing in a particular bin over A using a highly adaptive lasso (or other) classification model.
Value
A list
containing the break points used in dividing the
support of A
into discrete bins, the length of each bin, and the
reformatted data. The reformatted data is a data.table
of
repeated measures data, with an indicator for which bin an observation
fails in, the bin ID, observation ID, values of W
for each given
observation, and observation-level weights.