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
e.g. 1
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
e.g. 2
Ordered Data Set: 6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49
- 11 / 4 = 2.75 → 3
- lower quartile: 15
- 33 / 4 = 8.25 → 9
- upper: 43
in r
> j <- c(6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49) > quantile(j) 0% 25% 50% 75% 100% 6.0 25.5 40.0 42.5 49.0
Method r
- 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.”
—-
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.1568602589.txt.gz · Last modified: 2019/09/16 11:56 by hkimscil