quartile
This is an old revision of the document!
Table of Contents
Quartile
Symbol | Names | Definition |
Q1 | first quartile lower quartile 25th percentile | splits off the lowest 25% of data from the highest 75% 일사분위수 (하한사분위수) |
Q2 | second quartile median 50th percentile | cuts data set in half (중앙값) |
Q3 | third quartile upper quartile 75th percentile | splits off the highest 25% of data from the lowest 75% 삼사분위수 (상한사분위수) |
interquartile and outliers
사분범위 = Q3 - Q1
사분범위 = (상한사분위수) - (하한사분위수)
Finding lower and upper quartile
head first
- 하한
- n / 4 = ?
- 정수이면? 그 위치값과 다음 위치 값의 사이값
- 정수가 아니면? 올림을 한 위치의 값
- 상한
- 3n / 4 = ?
- 정수이면? 그 위치 값과 그 다음에 위치 값의 사이값
- 정수가 아니면? 올림을 한 위치 값
> k <- c(1:8) > k [1] 1 2 3 4 5 6 7 8 > quantile(k) 0% 25% 50% 75% 100% 1.00 2.75 4.50 6.25 8.00 >
그러나, 위의 방법으로는
lower quartile: 2.5
upper quartile: 6.5
Method 1
- Use the median to divide the ordered data set into two halves.
- If there is an odd number of data points in the original ordered data set, do not include the median (the central value in the ordered list) in either half.
- If there is an even number of data points in the original ordered data set, split this data set exactly in half.
- The lower quartile value is the median of the lower half of the data. The upper quartile value is the median of the upper half of the data.
- This rule is employed by the TI-83 calculator boxplot and “1-Var Stats” functions.
Method 2
- Use the median to divide the ordered data set into two halves.
- If there are an odd number of data points in the original ordered data set, include the median (the central value in the ordered list) in both halves.
- If there are an even number of data points in the original ordered data set, split this data set exactly in half.
- The lower quartile value is the median of the lower half of the data. The upper quartile value is the median of the upper half of the data.
- The values found by this method are also known as “Tukey's hinges.”
Ordered Data Set: 6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49
method 1 | method 2 | |
Q1 | 15 | 25.5 |
Q2 | 40 | 40 |
Q3 | 43 | 42.5 |
in r
> k <- c(1:8) > k [1] 1 2 3 4 5 6 7 8 > quantile(k) 0% 25% 50% 75% 100% 1.00 2.75 4.50 6.25 8.00 >
in r
> duration = faithful$eruptions # the eruption duration > quantile(duration) # apply the quantile function 0% 25% 50% 75% 100% 1.6000 2.1627 4.0000 4.4543 5.1000
quantile, not qurtile
quartile.1568602011.txt.gz · Last modified: 2019/09/16 11:46 by hkimscil