Let's say I have a set of test scores from 20 applicants
$5, 15, 16, 20, 21, 25, 26, 27, 30, 30, 31, 32, 32, 34, 35, 38, 38, 41, 43, 66$
Obviously, the median of this set would be $30$ and $31$, so I would just get the average, though that's not what I'm looking for.
What I'm really looking for is the median of the lower and upper quartiles.
I have found 2 ways, both yielding different answers.
1st way: Finding the lower quartile, the range would be $5$ to $30$, and the median of the set would be $21$. This is based on a video that I watched.
2nd way: Same problem, but instead of just finding the median, I use a formula.
$x_{kth}=(\frac{k}{4})n=\frac{1}{4}(20)=5$
This means the median for the lower quartile is the 5th spot, which is $21$. Sounds good, except that I have to do an extra step.
Get the average of the values $x_k$ and $x_{k+1}$ positions.
This means I have to average the 5th and 6th positions.
$Q_1=\frac{5_{th}+6_{th}}{2}=\frac{21+25}{2}=23$
This is entirely different from $21$. This method came from a textbook.
Which way is correct?