User Tools

Site Tools


quartile

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
quartile [2019/09/19 10:42] – [e.g. 2] hkimscilquartile [2019/09/24 10:29] – [e.g. 1] hkimscil
Line 12: Line 12:
  
 ====== Finding lower and upper quartile ====== ====== Finding lower and upper quartile ======
-===== e.g. 1 =====+===== e.g. 1, Head First method =====
  
 <code>> k <- c(1:8) <code>> k <- c(1:8)
Line 60: Line 60:
   * Use the median to divide the ordered data set into two halves.   * 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 odd number of data points in the original ordered data set, include the median (the central value in the ordered list) in both halves.
 +<code>
 +jh1 <- c(6, 7, 15, 36, 39, 40)
 +(15+36)/
 +jh2 <- c(40, 41, 42, 43, 47, 49)
 +(42+43)/2
 +</code>
 +
   * If there are an even number of data points in the original ordered data set, split this data set exactly in half.   * 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 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."   * The values found by this method are also known as "Tukey's hinges."
 +
 +???
 +<code>
 +> k <- c(6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49, 50)
 +> ks <- sort(k)
 +> ks
 + [1]  6  7 15 36 39 40 41 42 43 47 49 50
 +> length(ks)
 +[1] 12
 +> quantile(ks)
 +   0%   25%   50%   75%  100% 
 + 6.00 30.75 40.50 44.00 50.00 
 +
 +</code>
 +
 ---- ----
 in r in r
quartile.txt · Last modified: 2023/09/11 08:42 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki