Generate long format hazards data for conditional density estimation
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 numeric vector or similar of the observed values of an
intervention for a group of observational units of interest. |
| W |
A data.frame, matrix, or similar giving the values of
baseline covariates (potential confounders) for the observed units whose
observed intervention values are provided in the previous argument. |
| wts |
A numeric vector of observation-level weights. The default
is to weight all observations equally. |
| grid_type |
A character indicating the strategy (or strategies)
to be used in creating bins along the observed support of the intervention
A. For bins of equal range, use "equal_range"; consult documentation
of cut_interval for more information. To ensure each
bin has the same number of points, use "equal_mass"; consult documentation
of cut_number for details. |
| n_bins |
Only used if grid_type is set to "equal_range" or
"equal_mass". This numeric value indicates the number(s) of
bins into which the support of the intervention A is to be divided. |
| breaks |
A numeric vector of break points to be used in dividing
up the support of A. This is passed through the ... argument
to cut.default by cut_interval or
cut_number. |