R StatisticsLesson 32Free preview
R Mean Median Mode
This lesson is part of R · All levels
Summary
This study reviews three of the most fundamental measures of data centralization (Measures of Central Tendency): Mean (arithmetic mean), Median (middle value), and mode (most frequently occurring values). R has built-in functions mean() and median(), as well as the table() frequency table technique for finding the data mode.
Key points
- The 'mean()' function calculates the arithmetic mean: the sum of the values divided by the data
- The 'median()' function sorts the data and takes its middle value (resistant to outliers)
- R does not have an inborn mode() function for statistics (since 'mode()' in R refers to the object data type)
- The mode is calculated using a combination of the functions 'table()' and 'which.max() '
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.