prep_cv {HQM} | R Documentation |
Prepare for Cross validation bandwidth selection
Description
Implements the calculation of the hqm estimator on cross validation data sets. This is a preparation for the cross validation bandwidth selection technique for future conditional hazard rate estimation based on marker information data.
Usage
prep_cv(data, data.id, marker_name, event_time_name = 'years',
time_name = 'year',event_name = 'status2', n, I, b)
Arguments
data |
A data frame of time dependent data points. Missing values are allowed. |
data.id |
An id data frame obtained from |
marker_name |
The column name of the marker values in the data frame |
event_time_name |
The column name of the event times in the data frame |
time_name |
The column name of the times the marker values were observed in the data frame |
event_name |
The column name of the events in the data frame |
n |
Number of individuals. |
I |
Number of observations leave out for a K cross validation. |
b |
Bandwidth. |
Details
The function splits the data set via dataset_split
and calculates for every splitted data set the hqm estimator
for all on the marker grid and
on the time grid, where
is the marker,
is the exposure and
is the marker-only hazard, see
get_alpha
for more details.
Value
A list of matrices for every cross validation data set with for all
on the marker grid and
on the time grid.
See Also
Examples
pbc2_id = to_id(pbc2)
n = max(as.numeric(pbc2$id))
b = 1.5
I = 26
h_xt_mat_list = prep_cv(pbc2, pbc2_id, 'serBilir', 'years', 'year', 'status2', n, I, b)