View source: R/km_type_weights.R
compute_kmw_ncc | R Documentation |
<Private function> Compute KM-type weight for NCC sample given information on underlying cohort
compute_kmw_ncc( ncc, id_name, risk_table_manual, t_start_name = NULL, t_name, t_match_name = t_name, y_name, match_var_names = NULL, n_per_case, return_risk_table = FALSE, km_names = c(".km_prob", ".km_weight") )
ncc |
NCC data. A |
id_name |
Name of the column of the subject ID. A |
risk_table_manual |
A |
t_start_name |
Name of the column for the start time of follow-up. A string. Default is NULL, i.e., every subject started the follow-up at time 0. |
t_name |
Name of the column of the exact event/censoring time of each
subject. Note that for controls, this should not be the time of the event
in the same matched set. A |
t_match_name |
Name of the column of event time in each matched set in
|
y_name |
Name of the column of censoring status in each matched set in
|
match_var_names |
Name(s) of the match variable(s) in
|
n_per_case |
Number of controls matched to each case. |
return_risk_table |
Whether the risk table should be returned. Default
is |
km_names |
Column names for the KM-type probability (the first element)
and weight (the second element) computed, if these two columns are to be
attached to each subject in the input data. Default is
|
If return_risk_table = FALSE
(the default), returns a
data.frame
containing all the unique subjects selected in the NCC
sample, with a column for the KM-type weight associated with each subject.
If return_risk_table = TRUE
, returns a list containing this
subcohort (dat
) and the risk table (risk_table
), which is a
data.frame
containing the distinct (and exact) event time
(t_event
), matching variables (if any), and the number of subject at
risk at each event time in each strata defined by matching variables
(n_at_risk
).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.