Statistics 9/15

Percentiles

Percentiles are a general-position measure that works for any dataset, regardless of its shape. The kth percentile is the value such that k percent of the data are at or below it. In other words, you did better than k percent of the observations at the same time. The kth percentile does not have to be a value that appears in the data. For example, a 50th percentile is the median, because 50% of the data lie below the median. The median itself is the 50th percentile, since half the data are below it and half are above it. When calculating a general percentile, you first sort the data from smallest to largest. If you want the nth percentile, you compute the position k = (n/100) × N, where N is the sample size. With a small dataset (e.g., N = 10) the 90th percentile corresponds to 0.90 × 10 = 9, meaning it lies around the 9th value, and interpolation may place it between the 9th and 10th values. In the example discussed, the 90th percentile is described as being between 90 and 92, illustrating that the percentile can fall between data values rather than exactly on a data point.

The median is the 50th percentile. Since 50% of the data lies below the median, the median is the fiftieth percentile. When we calculate the median, we order the data from smallest to largest and locate the middle. For an even number of observations, the median is the average of the two middle values. For instance, in a small dataset with two middle values 77 and 82, the median would be
extMedian=rac77+822=79.5.ext{Median} = rac{77 + 82}{2} = 79.5.

Quartiles, the Five-Number Summary, and the IQR

Quartiles divide data into quarters. The first quartile Q1 is the 25th percentile, the second quartile Q2 is the 50th percentile (the median), and the third quartile Q3 is the 75th percentile. In the terminology used here, Q1 is often denoted as q1, Q2 as q2, and Q3 as q3. The five-number summary consists of the minimum value, Q1, Q2 (the median), Q3, and the maximum value. For the dataset discussed, the five-number summary is:

  • Minimum: 62

  • Q1: 71

  • Q2: 79.5

  • Q3: 88

  • Maximum: 94

The interquartile range (IQR) measures the spread of the middle 50% of the data and is defined as
extIQR=Q<em>3Q</em>1=8871=17.ext{IQR} = Q<em>3 - Q</em>1 = 88 - 71 = 17.

Outliers and the Fences

Outliers are data points that fall far from the rest of the data. They are identified using fences derived from the five-number summary and the IQR. The lower fence and the upper fence are given by
extLowerFence=Q<em>11.5imesextIQR,ext{Lower Fence} = Q<em>1 - 1.5 imes ext{IQR}, extUpperFence=Q</em>3+1.5imesextIQR.ext{Upper Fence} = Q</em>3 + 1.5 imes ext{IQR}.
Using the numbers from this dataset,
extLowerFence=711.5imes17=7125.5=45.5,ext{Lower Fence} = 71 - 1.5 imes 17 = 71 - 25.5 = 45.5,
extUpperFence=88+1.5imes17=88+25.5=113.5.ext{Upper Fence} = 88 + 1.5 imes 17 = 88 + 25.5 = 113.5.
Any data value below 45.5 or above 113.5 would be flagged as an outlier. In this example, the data range runs from 62 to 94, so there are no outliers because all values lie between 45.5 and 113.5.

If the data were altered (for example, replacing a value with 22), the minimum would drop to 22, and that value would then lie below the lower fence, making it an outlier. The fences therefore provide a practical rule for identifying outliers in skewed data.

Box Plots (Box-and-Whisker Plots)

A box plot visually represents the five-number summary and the IQR. The box spans from Q1 to Q3, with a line inside for the median (Q2). Whiskers extend from the box to the minimum and maximum values that are not outliers, and any outliers beyond the fences appear as individual points outside the whiskers. In a box plot for this dataset, the box would span from 71 to 88 with the median at 79.5. The whiskers would extend to the minimum value 62 and the maximum value 94, provided there are no outliers beyond the fences. If a hypothetical value such as 22 were present and classified as an outlier, it would appear as a dot beyond the lower whisker. Box plots also help reveal skew: if the mean is noticeably less than the median, the data are skewed toward the left (lower values); if the mean is greater than the median, the data are skewed toward the right (higher values).

When to Use Median and IQR vs Mean and SD

For datasets that are skewed or contain outliers, the mean and standard deviation are not resistant; a single extreme value can substantially shift them. In such cases, the median (a measure of central tendency) and the interquartile range (a measure of dispersion) are preferred because they are more robust to outliers and skew. In contrast, for data that are approximately symmetric and unimodal, the mean and standard deviation provide useful summaries.

Using StatCrunch to Compute Summary Statistics and Percentiles

StatCrunch can compute most of the summary statistics described above. To calculate a percentile, you go to Stat > Summary Stats > Columns, select the variable of interest, and use the Percentile option to enter the desired percentile k (for example, 90 for the 90th percentile). The result will give you the percentile value, though with small samples interpolation between data points may be involved, so the percentile value shown might not be an exact data value.

To obtain the five-number summary and the IQR in StatCrunch, you go to Stat > Summary Stats > Columns and select the needed items: minimum, Q1, Q2 (the median), Q3, maximum, and IQR. The software will display these values, which you can then use to compute the fences by hand. Note that the fences themselves are not provided directly by StatCrunch; you must apply the formulas
extLowerFence=Q<em>11.5imesextIQR,ext{Lower Fence} = Q<em>1 - 1.5 imes ext{IQR}, extUpperFence=Q</em>3+1.5imesextIQR.ext{Upper Fence} = Q</em>3 + 1.5 imes ext{IQR}.

Box plots can be generated in StatCrunch under Graphs > Boxplot, where you select the variable and choose horizontal or vertical orientation as a matter of preference. The box plot will show the box (from Q1 to Q3) with the median line inside, and whiskers extending to the data limits within the fences. If the data include outliers, StatCrunch will display them as individual points beyond the whiskers. The plotted axes should be scaled appropriately to avoid distortion of the visual, so you may set the axis to cover the data range with a sensible padding.

In the class workflow described, you will be given a dataset on the test, you will type the data into StatCrunch, and you will compute n (the number of observations), the mean, the median, the mode if it exists, the quartiles Q1 and Q3, the IQR, and the fences by hand. Those results will then be used to answer the test questions. You may also copy the resulting graphs from StatCrunch onto the test if you are presenting the answer on paper. The test itself is on paper, and you are allowed to use notes or the provided notes/video for reference. Be prepared to interpret both the numerical summaries and the graphs, including identifying whether outliers are present and how skewness is reflected in the box plot and in the relationship between the mean and the median.

Quick Practical Summary for Wednesday

  • Percentiles provide a distribution-free position measure; the 50th percentile is the median.

  • The five-number summary is (minimum, Q1, Q2, Q3, maximum);
    with the example: (62, 71, 79.5, 88, 94).

  • The IQR is
    extIQR=Q<em>3Q</em>1=17.ext{IQR} = Q<em>3 - Q</em>1 = 17.

  • Fences for outliers are
    extLowerFence=Q<em>11.5imesextIQR=45.5,ext{Lower Fence} = Q<em>1 - 1.5 imes ext{IQR} = 45.5, extUpperFence=Q</em>3+1.5imesextIQR=113.5.ext{Upper Fence} = Q</em>3 + 1.5 imes ext{IQR} = 113.5.
    Values outside these fences are outliers.

  • Box plots visualize the five-number summary, the IQR, and potential outliers; they help assess skew and the impact of outliers on the data.

  • On the test, you will input a dataset into StatCrunch, compute summary statistics (including n, mean, median, mode if any, Q1, Q3, and IQR), calculate the fences by hand, and then use those results to answer questions. You may use notes and the video during the test, and you may copy graphs and statistics from StatCrunch onto the test sheet if needed.