boot_cat_bin {foodingraph} | R Documentation |
Bootstrap inference on binary and categorical variables
Description
For a given dataset, performs a confidence-interval bootstrap of the mutual information or maximal information coefficient (MIC) for each pairwise association.
Computes the MI or MIC for each pairwise association.
Performs a bootstrap (of
boots
samples), and store each pairwise associationCalculate the 1th percentile for each pairwise association from the bootstrap distribution
If the percentile is inferior to the threshold of the corresponding pairwise variable type, then the MI or MIC is set to 0.
Usage
boot_cat_bin(obs_data, list_cat_var, list_bin_var, threshold_bin,
threshold_cat, threshold_bin_cat, method = c("mi", "mic"),
boots = 5000, show_progress = TRUE)
Arguments
obs_data |
(data.frame or matrix) : a dataset which rows are observations and columns the variables. |
list_cat_var |
: list of the categorical variables of the dataset |
list_bin_var |
: list of the binary variables of the dataset |
threshold_bin |
: the threshold to apply to binary pairwise associations |
threshold_cat |
: the threshold to apply to categorical pairwise associations |
threshold_bin_cat |
: to apply to a pairwise association between a binary and a categorical variable |
method |
: the method to use to compute the adjacency matrix
("mi" or "mic").
If "mi", uses mutual information package |
boots |
: number of bootstraps (default 5000) |
show_progress |
: if TRUE, prints the percentage of completion to keep track of the algorithm's progress. Default is TRUE. Recommended to FALSE for RMarkdown files. |
Value
The inferred adjacency matrix. All bootstrap 1th percentile values of each pairwise association inferior to their predefined thresholds will be set to 0.