View source: R/case_control_match.R
create_case_control_matched_df | R Documentation |
Create a data frame with cases and matched controls
create_case_control_matched_df( df, case_control_colname, case_value = "Case", control_value = "Control", matching_vars_categorical = NULL, matching_vars_continuous = NULL, n_control_ratio = 4, seed = 42 )
df |
A data frame |
case_control_colname |
Character. The name of an indicator column in
|
case_value |
String Used to determine which individuals are cases. This
value should be present in |
control_value |
String Used to determine which individuals are controls
This value should be present in |
matching_vars_categorical |
Character vector of column names containing categorical variables to match on. These columns should all be of type character. |
matching_vars_continuous |
Named integer vector. Names should be column
names containing continuous variables to match on (these columns should all
be of type numeric). Integer values are the number of digits to match to.
For example, |
n_control_ratio |
Integer. The number of controls to match for each case. |
seed |
Integer, for reproducibility. |
A data frame
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.