| pvaluescmink | R Documentation |
Using the Minkowski dissimilarity/distance for the dissimilarities/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 and a plot or plots (two or more) if the user select TRUE or leaves the parameter without argument.
pvaluescmink(
dataset,
formula,
pvalue.method = "permutation",
seed = NULL,
min_group_size = 3,
num_replicas = 1000,
p = 3,
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 Minkowski dissimilarities/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. |
p |
Order of the Minkowski dissimilarities/distances. The default value is 3. |
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 of p_values and, optionally, the plot.
When p < 1, the Minkowski distance is a "dissimilarity" measure. When p >= 1, the triangle inequality property is satisfied and we say "Minkowski distance". 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 continue.
pvaluescmink(CO2, ~Plant + Type,
pvalue.method = "permutation",
seed = 122,
num_replicas = 50,
p = 3,
grouping_stat = 'median',
automatic_encoding = TRUE)
pvaluescmink(airquality, ~Ozone,
pvalue.method = 'bootstrap',
p = 3,
na_removal = TRUE, num_replicas = 50)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.