Biology, images, analysis, design...
|"It has long been an axiom of mine that the little things are infinitely the most important" |
ModesOn this page: Example, with R, Definition and Use, Simple formula, Tips and Notes, Test yourself, References Download R R is Free, very powerful, and does the boring calculations & graphs for scientists.
Example, with R
Modes are the most common values in a set of data.
You can find a single mode, such as that, with R
This works well enough where there is a single identifiable mode - which may not be the case.
The variable called dist will have the frequency of every value in variable y, entering dist will reveal its contents.
Definition and Use
Assuming y is a 'normal' list of numbers, the midrange is the simplest way to assess the mode:
(yminimum + ymaximum)/2
A more popular way is to arbitrarily sub-divide y into n ranges of equal width, then select whichever range has most values.
Alternatively, the most common value may be selected.
Tips and Notes
You can see the effects of changing the class intervals with R
It may be sobering to recall that, for very good reasons, real data is usually 'rounded' or truncated in some fashion. The next example uses values truncated to 3 decimal points.