Estimate mode (ie most frequent value). The argument method
allows to choos among the so far 3 different methods available.
If 'denisty' is chosen, the most dense region of sqrt(n) values will be chosen;
if 'binning', the data will be binned (like in histograms) via rounding to a user-defined number of significant values ('rangeSign').
If method
is set to 'BBmisc', this function will use computeMode()
from package BBmisc.
stableMode(
x,
method = "binning",
histLike = NULL,
rangeSign = 1:6,
nCl = 50,
callFrom = NULL,
silent = FALSE
)
numeric vector
(character) There are 3 options : 'BBmisc', 'binning' and 'density'; If 'binning' the function will search context dependent, ie like most frequent class of histogram. Using this mode the search will be refined if either 80 percent of values in single class or >50 percent in single
(logical) depreciated, please use argument method
instead
(integer) only used when method='binning'
: range of numbers used as number of significant values
(integer) only used when method='binning'
: defines the number of classes used, very 'critical' parameter, may change results in strong way !! Note: higher values for 'nCl' will finally loose advantage of histLike-type search of mode !
(character) allow easier tracking of message(s) produced
(logical) suppress messages
mode value (numeric)
# NOT RUN {
set.seed(2012); dat <- round(c(rnorm(50),runif(100)),3)
stableMode(dat)
# }
Run the code above in your browser using DataLab