Skip to contents

This function tests the dataset's modality. It uses the modetest function from the multimode package written by Ameijeiras-Alonso et al. (2019) to determine the excess mass test statistic and test the number of modes. As a matter of course, this function runs the cleanData function, negating the need to run it separately.

Usage

modes(x = cutoffvalue:::exampledata)

Arguments

x

Your dataset specified as "DatasetName$ColumnName" or converted to a numeric list with a name (e.g., "yourrawdata <- as.numeric(yourrawdata$columnname)"). Regardless of how you import or specify it, data should be a single column of log-transformed data.

Value

Returns the p-value and excess mass statistic to determine whether the dataset is unimodal.

Examples

modetest <- modes(cutoffvalue:::exampledata)
#> Warning: A modification of the data was made in order to compute the excess mass or the dip statistic
#> Warning: A modification of the data was made in order to compute the excess mass or the dip statistic
#> Modality Test Results:
#>  - Excess mass = 0.097447 
#>  - p-value = 0.006 
#> **Reject null hypothesis** Distribution contains more than one mode; proceed with analyses.
#> 
#> Test Credit: Ameijeiras-Alonso et al. (2019) excess mass test
#>