Descriptive Statistics for Categorical and Quantitative Variables
Categorical Data Analysis and Two-Way Tables
StatKey Procedure for Analyzing Two Categorical Variables:
- Access data sets via the Course Resources page or the Everything Page for the unit in Blackboard within the embedded Google Drive folder.
- Download the data file
Celtics2024.csvto the local drive. - Navigate to StatKey and select Two Categorical Variables under the Descriptive Statistics and Graphs menu.
- Upload
Celtics2024.csv. - Column selection determines axis placement: selecting
Location() first andWin() second places the categories ofLocationas labels along the horizontal axis beneath the bars. - General modeling rule: The explanatory variable belongs under the bars on the horizontal axis.
- Clicking the Switch Variables button adjacent to the Counts Table interchanges the explanatory and response variables, changing which variable labels the horizontal axis.
- Clicking Change Columns allows selection of alternative variables, such as selecting
Opp() followed byWin() to isolate specific team matchups where the Celtics won every game or lost every game in .
Two-Way Table Counts ( Boston Celtics):
- Total Away wins recorded:
- Total Home wins recorded:
Row Proportions and Association:
- Calculating row proportions provides conditional probabilities for game outcomes based on venue:
- Proportion of Away games won:
- Proportion of Home games won:
- Evaluation of association: An association exists between
LocationandWin. The substantial disparity in win proportions ( at home versus away) demonstrates a measurable homefield/homecourt advantage.
Stacked Bar Graph Interpretation:
- In the default stacked bar graph visualization, hovering the cursor over any colored segment highlights the corresponding cell in the two-way contingency table, showing the exact frequency and conditional breakdown represented by that region.
Histograms, Bins, and Quantitative Data Distributions
Histogram Foundations and Bin Construction:
- A histogram summarizes quantitative data by grouping numerical values into intervals called bins.
- Each bin is defined by an inclusive left endpoint and an exclusive right endpoint: .
- The height of each bar represents the frequency (count of data values) falling within that specific bin interval.
Lake Travis Water Level Case Study ():
- Data source: Lower Colorado River Authority (LCRA) website, recording water elevation in feet by year:
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- :
- Bin identification example:
- For the bar centered at with a frequency height of :
- Left endpoint:
- Right endpoint:
- Observed value within the interval : Lake level of in the year .
- Threshold evaluation for reservoir capacity:
- Lake Travis is considered full when near , operationally defined as reaching at least .
- Summing bar heights for all bins situated to the right of yields .
- Verification against raw data points ():
- : (), (), (), (), () []
- : (), (), (), (), (), () []
- : (), (), (), (), () []
- : () []
- Total verified count: .
Effect of Bin Size on Visualization:
- Setting () results in overly narrow bins, displaying excessive noise and too much detail to identify underlying trends.
- Setting () results in overly wide bins, over-aggregating data and displaying too little detail to observe the shape of the distribution.
Distribution Shapes, Modality, and Outliers
Symmetry and Skewness Classifications:
- Symmetric / Bell-shaped: Data values are evenly distributed on either side of the center, creating a mirrored balance around the peak.
- Left Skew (Negative Skew): The distribution exhibits a prolonged left-side tail stretching toward smaller values, while the mass of observations clusters at the upper end.
- Right Skew (Positive Skew): The distribution exhibits a prolonged right-side tail stretching toward larger values, while the mass of observations clusters at the lower end.
Modality Classifications:
- Unimodal: A distribution with a single prominent peak.
- Bimodal: A distribution displaying two distinct peaks.
- Example: Part Retrieval Times at a Central Warehouse (measuring retrieval time in minutes against frequency).
- The warehouse distribution is bimodal with two separate processes: a "Quick Retrieval" peak centered at approximately and a "Slow Retrieval" peak centered between .
- Multimodal: A distribution with more than two distinct peaks.
Outlier Characterization:
- Definition: An outlier is an observed value notably distinct from the rest of the dataset, being significantly smaller or significantly larger than the primary body of data.
- Misconception warning: The tallest bars on a histogram are NOT outliers. Tall bars represent the mode (the most common values) and mark the distribution center. Outliers appear as isolated, short bars separated by empty space far in the tails.
Empirical Shape and Outlier Examples:
- Height in Inches:
- Symmetry/Skew: Symmetric
- Modality: Unimodal
- Outliers: No outliers
- Miles from Campus to Home:
- Symmetry/Skew: Right skew
- Modality: Unimodal
- Outliers: located far in the right tail
- Siblings:
- Symmetry/Skew: Right skew
- Modality: Unimodal
- Outliers: at high sibling counts
- Diamond Depth ():
- Symmetry/Skew: Nearly symmetric (mild right skew)
- Modality: Unimodal
- Outliers: No outliers
Mean and Standard Deviation Computations
Formulas and Definitions:
- Sample Mean (): The arithmetic average representing the center of the quantitative distribution:
- Sample Standard Deviation (): The measure of average spread or dispersion about the mean:
- Note on usage: The mean formula is applied manually for simple datasets; standard deviation is calculated using software rather than manual hand computation.
Sample Mean Calculation:
- Four test scores: , , , and
- Summation of values:
- Mean calculation:
Standard Deviation Spread Intervals:
- Heights of Adults in the US data set (, ):
- Center:
- One standard deviation below:
- One standard deviation above:
- Two standard deviations below:
- Two standard deviations above:
- Location on dotplot: and mark boundaries containing nearly all data points, leaving only extreme dots in the outer tails.
- Heights of Professional Basketball Players data set (, ):
- Center:
- Two standard deviations below:
- Two standard deviations above:
- Consistency: The relative position of across different datasets remains constant; in any roughly bell-shaped distribution, the interval spans virtually the entirety of the typical data values.
The 95% Rule and Graphical Estimation of Spread
The 95% Rule (Empirical Rule for Bell-Shaped Distributions):
- In any symmetric, bell-shaped distribution, approximately of all observed values fall within two standard deviations of the mean:
- The distribution is partitioned by standard deviation marks:
- Dividing the outer tails:
- Middle range:
- Total outside the interval:
- Lower tail (values below ):
- Upper tail (values above ):
Estimating Standard Deviation from Graphs:
- Let represent the lower bound of the middle ().
- Let represent the upper bound of the middle ().
- The total range covering the central equals four standard deviations:
- Estimating formula:
- Graph application: On rainfall histograms (such as Annual Rainfall in Austin ), estimating the bounds containing the central allows direct approximation of .
Sample Dotplot Estimation with Given Sample Size ( Cases):
- Total observations:
- Middle data proportion:
- Outside data proportion: total, divided into in each tail.
- Calculating count of extreme data points:
- Dividing between tails:
- Determining boundary values by counting extreme dots:
- Counting the lowest establishes the Lower bound:
- Counting the highest establishes the Upper bound:
- Computing the estimated standard deviation: