Likewise, the median()
, sd()
, var()
, and range()
functions exists to calculate the median, (sample) standard deviation, (sample) variance, and range (as an interval) respectively. Remember that the sample standard deviation or variance formulas have a denominator of \(n - 1\) rather than \(n\).
Mode
Mode is a less common calculation and R does not have a function to calculate it.
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.
Calculating summary statistics in Desmos
In Desmos, you can enter a list of numbers like \[ a = [1, 2, 3, 4, 5, 6] \text{ or } a = [1...6]. \] (Variables in Desmos are limited to a single letter.)
Statistic | R | Desmos |
---|---|---|
Mean | mean(a) | mean(a) |
Median | median(a) | median(a) |
(Sample) Variance | var(a) | var(a) |
(Sample) Standard Deviation | sd(a) | stdev(a) |
Range (as an interval) | range(a) | (min(a), max(a)) |