can somebody please help me to understand? Why 1st quartile in this data is equal 4.5 and 3rd quartile is equal 6.5.
I am getting 4.25 and 6.25 , but not 4.5 and not 6.5. I use formula (n+1)/4 for the first quartile and 3/4(n+1) for the 3rd quartile. For the 1st quartile :(8+1)/4= 9/4 = 2 1/4, so the Q1 is the second number and the quarter way forward. or 4.25
2 4 5 6 6 6 7 8
What am I doing wrong. Thanks in advance.
The first quartile should have at least $\frac14$ of the data points at or below it and at least $\frac34$ of the data points at or above it. In the case where the number of data points is divisible by $4$, there can be a gap between the greatest value in the first $\frac14$ of the data points and the least value in the last $\frac34$ of the data points, and then there is a convention to put the first quartile midway between those two points.
For the first quartile, then, if there are $n$ data points then you can compute $k = \frac n4$. If $k$ is an integer, you count off $k$ values starting with the smallest, and put $Q_1$ midway between the $k$th value and the $(k + 1)$th value. If $k$ is not an integer, you count off $\lfloor k \rfloor$ data points and $Q_1$ is the next data point.
The third quartile works similarly, but with $k = \frac 34 n$ instead of $\frac n4$.
It's important to remember that $n$ in these formulas is not one of the data values, and you do not add the result of $\frac n4$ to any data value; you use $\frac n4$ to count data values.
It's not clear where you got the formulas $\frac14(n+1)$ or $\frac34(n+1)$. Perhaps they were intended to work with a data set labeled $y_0, y_1, y_2, \ldots, y_n$, which actually has $n+1$ data points because its first data point is $y_0$.