Monday, April 13, 2020

mode

A measure of center. In a data set, the number that occurs most frequently.
R has no native method for determining the mode. You need to either create a function (probably using which.max and table), or install the modeest package.

R Example

I'm not going to include it here on first writing. If I ever need to calculate it, I'll add the code I use at that time. Workarounds: create a histogram

Update: during my study I found a workaround using two functions, which.max and maxFreq:

Briefly:

> which.max(table(variable))
"Most Frequent Value"

> maxFreq(variable)
"How often"




No comments:

Post a Comment

Please help to combat malicious use of the Internet.