Description Usage Arguments Details Value Author(s) References See Also Examples
A measure of one-dimensional multimodality based on p-values of the diptest.
A jittering whose intensity depends on the value of discrete1d
is used to prevent ties.
The function dip.test
from package diptest is used for calculating the p-value.
1 | multimod1d(x, seed = NULL, exp = 1)
|
x |
A numeric vector, a numeric matrix or a data frame. |
seed |
An integer. The seed which is used for the jittering. If |
exp |
A positive integer. Controls the sensitivity of the result with |
The specific result of the function depends on the seed, its default can be changed by setting seed
. A normally distributed vector, generated by rnorm
with mean=0
and sd=discrete1d(x)*sd(x,na.rm=T)/5
, is added to x
to break ties.
To control the sensitivity of the measure an exponent can be choosen which influences the value by (1-p-value)^exp
. Higher values of exp
are recommended if a data set has a huge number of multimodal variables. Higher values makes it easier to seperate clear multimodal structures from not so clear ones. For example an exponent of 10
implies a value of 0.6
when (1-p-value)^exp=0.95
(this is the value for exp=1
).
A single value or a vector including the results of skew1d
for each variable (in case of numeric matrices or data frames). If variables from data frames are categorical, 'NA' is returned.
Katrin Grimm
M. Maechler (2015) diptest: Hartigan's Dip Test Statistic for Unimodality - Corrected. https://CRAN.R-project.org/package=diptest.
J. A. Hartigan and P. M. Hartigan (1985) The Dip Test of Unimodality. Annals of Statistics 13(1), 70–84.
P. M. Hartigan (1985) Algorithm AS 217: Computation of the Dip Statistic to Test for Unimodality. Journal of the Royal Statistical Society. Series C (Applied Statistics) 34(3), 320–325.
skew1d
, discrete1d
, iaunivariate
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data(Election2005)
## Not run:
multimod <- multimod1d(Election2005)
maxv <- order(multimod,decreasing=TRUE)[1:4]
par(mfrow=c(2,2))
for(i in 1:4){
hist(Election2005[,maxv[i]],xlab="",breaks=30,
main=paste(names(Election2005[maxv[i]])))
}
# Explore skewness, multimodality and discreteness within interactive environment.
iaunivariate(Election2005)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.