Descriptive Statistics Comparison and Implementation
Descriptive Statistics for Quantitative Variables: Cumulative Perspective
Analyzing quantitative data requires examining the distribution of outcomes beyond simple frequency tables and histograms.
The cumulative perspective utilizes tools such as the Empirical Cumulative Distribution Function (, also known as ECDF) and boxplots to visualize data distribution.
Key summary measures in this perspective include percentiles, specifically the median (), the first quartile (), the third quartile (), and the interquartile range (IQR).
Techniques for analysis vary depending on whether the variable is discrete, continuous (raw data), or continuous (binned data).
Discrete Variables and the Empirical Cumulative Distribution Function
Analysis of discrete variables relies heavily on the frequency table, specifically the cumulative relative frequencies ().
Definition of ECDF (): The goal is to represent the cumulative relative frequency as a step function. For values smaller than the first outcome, the function is . At each discrete outcome, the function "jumps" to the next cumulative relative frequency value and remains horizontal until the next outcome is reached.
Example Plotting Points: For a dataset where and , the step function connects coordinates in a sequence: , , , , , and so on until reaching .
Step-by-Step Construction of the Discrete ECDF in Excel
Preparing Auxiliary Columns:
Copy the original outcomes (e.g., cells
C6:C16) into a new column twice (e.g.,I4:I14andI15:I25).Sort this combined range in ascending order so each outcome appears twice consecutively.
Define a corresponding Y-value column (
Fhat). For each outcome that appears twice, the first Y-value should be the cumulative relative frequency of the previous outcome to create the horizontal level. The second Y-value should be the cumulative relative frequency of the current outcome to create the vertical jump.
Logic Functions for Construction:
=INDEX(range, row_num, [col_num]): This function returns a value from a specific position in a range. For example,=INDEX(A2:C4, 2, 3)returns the value in cellC3(2nd row, 3rd column). If only one column is provided, only the row number is needed.=INT(number): Rounds a number down to the nearest integer. For instance,=INT(1.6)results in .=IF(logical_test, [value_if_true], [value_if_false]): Used to determine if the current X-value matches the previous one to decide whether to copy the previous cumulative value (horizontal segment) or pull the new cumulative relative frequency (vertical jump).
Charting the Function:
Select the auxiliary range ( and values).
Go to Insert > Chart > X Y (Scatter).
Change the subtype to Scatter with Straight Lines.
Adjust axis bounds: Set the X-axis minimum to and maximum to the highest outcome (e.g., ). Set the Y-axis minimum to and maximum to .
Interpretation Note: Only the horizontal segments are technically part of the step function; vertical lines are artifacts of the line-connecting feature in Excel and should be ignored.
Discrete Variable Percentiles and Boxplots
Percentile Definition for Discrete Variables: The -th percentile is defined as the smallest outcome such that the cumulative relative frequency is at least .
Manual Construction: Excel does not have a simple command for discrete boxplots following this specific definition. They are typically constructed manually on paper by reading the values from the frequency table:
First Quartile (): Smallest outcome where .
Median (): Smallest outcome where .
Third Quartile (): Smallest outcome where .
90th Percentile: Smallest outcome where .
Continuous Variables: Raw Data Analysis
When raw data is available, the cumulative perspective relies on ordering outcomes from smallest to largest.
Empirical Distribution Function for Continuous Raw Data:
Identify the sample size () using
=COUNT(range).Sort the raw data in ascending order.
Duplicate the data in an auxiliary column (each value appears twice) to create the step function logic similar to discrete variables.
Use
=IF(M4=M3, COUNTIF($A$2:$A$101, "<="&M4)/$H$2, N3)to calculate cumulative steps, whereH2is the sample size.
Percentile Calculation Strategies for Raw Data
Different statistical software and calculators use slightly different strategies for percentiles. Most begin by finding the theoretical position of the percentile in a sorted list of length .
TI-84/Interpolation Method:
Calculate the position: .
If the position is an integer , the percentile is the -th observation in the sorted range.
If the position is not an integer, take the average of the -th and -th observations, where is the integer immediately below the calculated position.
Excel Built-in Functions:
=PERCENTILE.EXC(range, k): Uses the position . It uses linear interpolation between values rather than a simple average. This function excludes and .=PERCENTILE.INC(range, k): Uses the position . It includes extreme values ( and ).=QUARTILE.INC/=QUARTILE.EXC: Specifically for quartiles (, , or ).=MEDIAN(range): All standard definitions result in the same value for the median.
Boxplots for Raw Data in Excel
Creation: Select raw data and navigate to Insert > Chart > Box and Whisker.
Formatting:
Excel defaults to the
PERCENTILE.EXCmethod. To change this, right-click the plot, select Format Data Series, and set the Quartile calculation field to Inclusive median (matchingPERCENTILE.INC).Mean Marker: Represented by an "" in the boxplot. This is selected by default via Show Mean Markers.
Cleaning: Remove group labels () on the X-axis and add clear Y-axis labels.
Continuous Variables: Binned Data Analysis
When raw data is unavailable and only a frequency table with bins is provided, interpolation is necessary.
ECDF for Binned Data:
The ECDF is generated based on the cumulative relative frequencies of the upper bounds of each bin.
The graph starts at the lowest lower bound with a of .
Instead of a step function, points are joined by straight lines (linear interpolation), resulting in a continuous graph.
Percentiles via Linear Interpolation:
Percentiles must be calculated manually using the formula based on the frequency table.
Example Calculation (): If the cumulative relative frequency for the bin edge is and for is , the first quartile () lies within the bin .
Formula:
Using provided values: .
Summary of Analytical Goals by Data Type
Data Type | ECDF Strategy | Percentile Strategy | Boxplot Strategy |
|---|---|---|---|
Discrete | Step function (frequency table + auxiliary columns). | Smallest outcome where . | Manual construction on paper. |
Continuous (Raw) | Step function (sorted data + auxiliary columns). |
| Excel Box and Whisker chart. |
Continuous (Binned) | Continuous function (upper bounds connected by lines). | Linear interpolation formulas. | Manual construction on paper. |