Likewise, the median()
, sd()
, var()
, and range()
functions exists to calculate the median, (sample) standard deviation, (sample) variance, and range respectively. Remember that the sample s.d. or var formulas have a denominator of \(n - 1\) rather than \(n\).
3.1 Mode
Mode is a less common calculation and the mode()
function in R does not calculate the mode but does something much different having to do with programming internals.
Instead, we can calculate the mode as we did in Activity 1 by using the table()
function and then reading the output to determine which data point occurred the most.