| pvalueschamm | R Documentation |
Using the Hamming distance for the distances calculation, this function takes a dataframe, a variable or variables (two or more), a p_value method such as "bootstrap" and "permutation" and returns the p_values matrix or matrices (two or more) between each pair of factors.
pvalueschamm(
dataset,
formula,
pvalue.method = "permutation",
seed = NULL,
min_group_size = 3,
num_replicas = 1000,
automatic_encoding = FALSE,
na_removal = FALSE,
grouping_stat = "median"
)
dataset |
A dataframe. |
formula |
A variable or variables (two or more) with factors which you want to calculate the Hamming distances matrix or matrices (two or more). |
pvalue.method |
A p_value method used to calculate the matrix or matrices (two or more), the default value is "permutation". Another method is "bootstrap". |
seed |
Optionally, set a seed for "bootstrap" and "permutation". |
min_group_size |
Minimum group size to maintain. The default value is 3, therefore groups, inside variables, with less than 3 observations will be discarded. |
num_replicas |
Number of permutations or bootstraps trials, the default value is 1000. |
automatic_encoding |
Logical, if TRUE, names inside factor variables will be transformed in numbers with ordinal order (1,2,....). |
na_removal |
Logical, if TRUE, missing value removal on rows is performed. |
grouping_stat |
When a factor variable is specified, calculate the specified grouping statistic for each factor. Available methods are: mean (arithmetic mean), median and SDS (standard deviations). Then, we find p-values with the resulting distances. |
A list containing a matrix or matrices (two or more) of p_values.
This function leverages on an early stopping procedure in which the resulting matrix is printed also if the specified number of replicas is not reached; if every 500 replicas the maximum difference between each p_value does not exceed 0.0001, the function will print the entire matrix, else it continues.
pvalueschamm(CO2, ~Plant + Type,
pvalue.method = "permutation",
seed = 122,
num_replicas = 50,
grouping_stat = 'median',
automatic_encoding = TRUE)
pvalueschamm(airquality, ~Ozone,
pvalue.method = 'bootstrap',
na_removal = TRUE, num_replicas = 50)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.