Description Usage Arguments Value Author(s) Examples
Calculates variable-wise Kullback-Leibler divergence between the two groups of samples which violate the linear relationship between two continuous variables.
1 2 |
data |
A numeric dataframe including no missing value |
var1 |
A vector of continuous values indicating the first variable. (the order of values should be the same as the order of rows in data) |
var2 |
A vector of continuous values indicating the second variable. (the order of values should be the same as the order of rows in data) |
permute |
An integer indicating the number of permutations for permutation test. If 0 (the default) no permutation test will be carried out. |
levels |
An integer value indicating the maximum number of levels of a categorical variable. To be used to distinguish the categorical variable. Defaults to NULL because it is supposed that |
plot |
A logical indicating if the scatter plot of two variables is returned. It highlights the two outlier groups with different colors. |
var1.name |
The name of the first variable to be shown on the plot. |
var2.name |
The name of the second variable to be shown on the plot. |
If permute = 0 returns a dataframe including sorted Kullback-Liebler (KL) divergence. If permute > 0 returns a dataframe including p.values and sorted KL divergence.
Elyas Heidari
1 2 3 4 5 6 7 8 9 10 | data("NHANES")
## Using preprocessed data
data <- data_preproc(NHANES, levels = 15)
data$SEQN <- NULL
# Set permute to calculate p.values
kl <- VVKL(data, var1 = data$LBXTC, var2 = data$LBXVIE, permute = 100, levels = NULL)
## Using raw data and plot
kl <- VVKL(NHANES, var1 = data$LBXTC, var2 = data$LBXVIE, permute = 0, levels = 15,
plot = TRUE, var1.name = 'LBXTC', var2.name = 'LBXVIE')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.