The median value is the value in the middle, after you have sorted all the values.
If we take a look at the values of the
wt variable (from the
mtcars data set), we will see that there are two numbers in the middle:
Sorted observation of wt (weight)
Note: If there are two numbers in the middle, you must divide the sum of those numbers by two, to find the median.
Luckily, R has a function that does all of that for you: Just use the
function to find the middle value:
Find the mid point value of weight (
Data_Cars <- mtcars