Comment: Following @Dave's Comment, here are some of the different
outputs for the quantiles in R. I was motivated to list them because
it seems none of them match the values you give for the quartiles.
It is not possible to divide nine observations into four 'quarters', so conventions
need to be established how to get sensible quartiles. Each of the 'types'
in R exists because there are people who think each one is 'best' for certain
purposes.
Fortunately, quantiles are usually used in applications with much larger
sample sizes, so that the minor differences in the definitions of
quantiles do not often result in important differences in reported values.
While you are in your current statistics course, you should certainly follow
the advice of @Henry and @Glen_b: Figure out your instructor's method and
use it. After you get out of school, you can decide which 'type' of
quantile is your favorite.
x = c(23, 32, 33, 47, 40, 43, 44, 47, 52)
sort(x)
[1] 23 32 33 40 43 44 47 47 52
quantile(x, type=1)
0% 25% 50% 75% 100%
23 33 43 47 52
quantile(x, type=2)
0% 25% 50% 75% 100%
23 33 43 47 52
quantile(x, type=3)
0% 25% 50% 75% 100%
23 32 40 47 52
quantile(x, type=4)
0% 25% 50% 75% 100%
23.00 32.25 41.50 46.25 52.00
quantile(x, type=5)
0% 25% 50% 75% 100%
23.00 32.75 43.00 47.00 52.00
quantile(x, type=6)
0% 25% 50% 75% 100%
23.0 32.5 43.0 47.0 52.0
quantile(x) # 'type 7 is the default in R
0% 25% 50% 75% 100%
23 33 43 47 52
quantile(x, type=8)
0% 25% 50% 75% 100%
23.00000 32.66667 43.00000 47.00000 52.00000
quantile(x, type=9)
0% 25% 50% 75% 100%
23.0000 32.6875 43.0000 47.0000 52.0000