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.csv to 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 (Home/Away\text{Home/Away}) first and Win (Win/Loss\text{Win/Loss}) second places the categories of Location as 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 (Opponent\text{Opponent}) followed by Win (Win/Loss\text{Win/Loss}) to isolate specific team matchups where the Celtics won every game or lost every game in 20242024.
  • Two-Way Table Counts (20242024 Boston Celtics):

    • Total Away wins recorded: 2727
    • Total Home wins recorded: 3737
  • Row Proportions and Association:

    • Calculating row proportions provides conditional probabilities for game outcomes based on venue:
    • Proportion of Away games won: 0.6590.659
    • Proportion of Home games won: 0.9020.902
    • Evaluation of association: An association exists between Location and Win. The substantial disparity in win proportions (0.9020.902 at home versus 0.6590.659 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: [Left,Right)[\text{Left}, \text{Right}).
    • The height of each bar represents the frequency (count of data values) falling within that specific bin interval.
  • Lake Travis Water Level Case Study (1980–20161980\text{--}2016):

    • Data source: Lower Colorado River Authority (LCRA) website, recording water elevation in feet by year:
    • 19801980: 673 ft673\text{ ft}
    • 19811981: 680 ft680\text{ ft}
    • 19821982: 681 ft681\text{ ft}
    • 19831983: 667 ft667\text{ ft}
    • 19841984: 668 ft668\text{ ft}
    • 19851985: 669 ft669\text{ ft}
    • 19861986: 678 ft678\text{ ft}
    • 19871987: 684 ft684\text{ ft}
    • 19881988: 677 ft677\text{ ft}
    • 19891989: 668 ft668\text{ ft}
    • 19901990: 655 ft655\text{ ft}
    • 19911991: 678 ft678\text{ ft}
    • 19921992: 691 ft691\text{ ft}
    • 19931993: 679 ft679\text{ ft}
    • 19941994: 668 ft668\text{ ft}
    • 19951995: 673 ft673\text{ ft}
    • 19961996: 671 ft671\text{ ft}
    • 19971997: 677 ft677\text{ ft}
    • 19981998: 680 ft680\text{ ft}
    • 19991999: 682 ft682\text{ ft}
    • 20002000: 664 ft664\text{ ft}
    • 20012001: 682 ft682\text{ ft}
    • 20022002: 682 ft682\text{ ft}
    • 20032003: 682 ft682\text{ ft}
    • 20042004: 669 ft669\text{ ft}
    • 20052005: 682 ft682\text{ ft}
    • 20062006: 664 ft664\text{ ft}
    • 20072007: 646 ft646\text{ ft}
    • 20082008: 682 ft682\text{ ft}
    • 20092009: 655 ft655\text{ ft}
    • 20102010: 657 ft657\text{ ft}
    • 20112011: 668 ft668\text{ ft}
    • 20122012: 626 ft626\text{ ft}
    • 20132013: 632 ft632\text{ ft}
    • 20142014: 628 ft628\text{ ft}
    • 20152015: 624 ft624\text{ ft}
    • 20162016: 686 ft686\text{ ft}
    • Bin identification example:
    • For the bar centered at 620 ft620\text{ ft} with a frequency height of 11:
    • Left endpoint: 615 ft615\text{ ft}
    • Right endpoint: 625 ft625\text{ ft}
    • Observed value within the interval [615,625)[615, 625): Lake level of 624 ft624\text{ ft} in the year 20152015.
    • Threshold evaluation for reservoir capacity:
    • Lake Travis is considered full when near 680 ft680\text{ ft}, operationally defined as reaching at least 675 ft675\text{ ft}.
    • Summing bar heights for all bins situated to the right of 675 ft675\text{ ft} yields 17 years17\text{ years}.
    • Verification against raw data points (≥675 ft\ge 675\text{ ft}):
      • 1980–19891980\text{--}1989: 19811981 (680680), 19821982 (681681), 19861986 (678678), 19871987 (684684), 19881988 (677677) [5 years5\text{ years}]
      • 1990–19991990\text{--}1999: 19911991 (678678), 19921992 (691691), 19931993 (679679), 19971997 (677677), 19981998 (680680), 19991999 (682682) [6 years6\text{ years}]
      • 2000–20092000\text{--}2009: 20012001 (682682), 20022002 (682682), 20032003 (682682), 20052005 (682682), 20082008 (682682) [5 years5\text{ years}]
      • 2010–20162010\text{--}2016: 20162016 (686686) [1 year1\text{ year}]
      • Total verified count: 5+6+5+1=17 years5 + 6 + 5 + 1 = 17\text{ years}.
  • Effect of Bin Size on Visualization:

    • Setting 20 bins20\text{ bins} (bin size=4\text{bin size} = 4) results in overly narrow bins, displaying excessive noise and too much detail to identify underlying trends.
    • Setting 5 bins5\text{ bins} (bin size=20\text{bin size} = 20) 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 2 minutes2\text{ minutes} and a "Slow Retrieval" peak centered between 8 and 10 minutes8\text{ and } 10\text{ minutes}.
    • 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: 2 possible outliers2\text{ possible outliers} located far in the right tail
    • Siblings:
    • Symmetry/Skew: Right skew
    • Modality: Unimodal
    • Outliers: 2 possible outliers2\text{ possible outliers} at high sibling counts
    • Diamond Depth (mm\text{mm}):
    • Symmetry/Skew: Nearly symmetric (mild right skew)
    • Modality: Unimodal
    • Outliers: No outliers

Mean and Standard Deviation Computations

  • Formulas and Definitions:

    • Sample Mean (xˉ\bar{x}): The arithmetic average representing the center of the quantitative distribution:     xˉ=x1+x2+⋯+xnn=∑xn\bar{x} = \frac{x_1 + x_2 + \dots + x_n}{n} = \frac{\sum x}{n}
    • Sample Standard Deviation (ss): The measure of average spread or dispersion about the mean:     s=∑(x−xˉ)2n−1s = \sqrt{\frac{\sum (x - \bar{x})^2}{n - 1}}
    • 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: 8787, 6565, 4242, and 9898
    • Summation of values:     ∑x=87+65+42+98=292\sum x = 87 + 65 + 42 + 98 = 292
    • Mean calculation:     xˉ=2924=73\bar{x} = \frac{292}{4} = 73
  • Standard Deviation Spread Intervals:

    • Heights of Adults in the US data set (xˉ=69\bar{x} = 69, s=3s = 3):
    • Center: xˉ=69\bar{x} = 69
    • One standard deviation below: xˉ−s=69−3=66\bar{x} - s = 69 - 3 = 66
    • One standard deviation above: xˉ+s=69+3=72\bar{x} + s = 69 + 3 = 72
    • Two standard deviations below: xˉ−2s=69−2(3)=69−6=63\bar{x} - 2s = 69 - 2(3) = 69 - 6 = 63
    • Two standard deviations above: xˉ+2s=69+2(3)=69+6=75\bar{x} + 2s = 69 + 2(3) = 69 + 6 = 75
    • Location on dotplot: xˉ−2s=63\bar{x} - 2s = 63 and xˉ+2s=75\bar{x} + 2s = 75 mark boundaries containing nearly all data points, leaving only extreme dots in the outer tails.
    • Heights of Professional Basketball Players data set (xˉ=77\bar{x} = 77, s=1.2s = 1.2):
    • Center: xˉ=77\bar{x} = 77
    • Two standard deviations below: xˉ−2s=77−2(1.2)=77−2.4=74.6\bar{x} - 2s = 77 - 2(1.2) = 77 - 2.4 = 74.6
    • Two standard deviations above: xˉ+2s=77+2(1.2)=77+2.4=79.4\bar{x} + 2s = 77 + 2(1.2) = 77 + 2.4 = 79.4
    • Consistency: The relative position of xˉ±2s\bar{x} \pm 2s 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 95%95\% of all observed values fall within two standard deviations of the mean:     [xˉ−2s,xˉ+2s][\bar{x} - 2s, \bar{x} + 2s]
    • The distribution is partitioned by standard deviation marks:     xˉ−3s,xˉ−2s,xˉ−s,xˉ,xˉ+s,xˉ+2s,xˉ+3s\bar{x} - 3s, \bar{x} - 2s, \bar{x} - s, \bar{x}, \bar{x} + s, \bar{x} + 2s, \bar{x} + 3s
    • Dividing the outer tails:
    • Middle range: 95%95\%
    • Total outside the interval: 100%−95%=5%100\% - 95\% = 5\%
    • Lower tail (values below xˉ−2s\bar{x} - 2s): 2.5%2.5\%
    • Upper tail (values above xˉ+2s\bar{x} + 2s): 2.5%2.5\%
  • Estimating Standard Deviation from Graphs:

    • Let Lower\text{Lower} represent the lower bound of the middle 95%95\% (xˉ−2s\bar{x} - 2s).
    • Let Upper\text{Upper} represent the upper bound of the middle 95%95\% (xˉ+2s\bar{x} + 2s).
    • The total range covering the central 95%95\% equals four standard deviations:     Upper−Lower=(xˉ+2s)−(xˉ−2s)=4s\text{Upper} - \text{Lower} = (\bar{x} + 2s) - (\bar{x} - 2s) = 4s
    • Estimating formula:     s≈Upper−Lower4s \approx \frac{\text{Upper} - \text{Lower}}{4}
    • Graph application: On rainfall histograms (such as Annual Rainfall in Austin 1856–20121856\text{--}2012), estimating the bounds containing the central 95%95\% allows direct approximation of ss.
  • Sample Dotplot Estimation with Given Sample Size (n=360n = 360 Cases):

    • Total observations: n=360n = 360
    • Middle data proportion: 95%95\%
    • Outside data proportion: 5%5\% total, divided into 2.5%2.5\% in each tail.
    • Calculating count of extreme data points:     0.05×360=18 dots on the extremes0.05 \times 360 = 18\text{ dots on the extremes}
    • Dividing between tails:     0.025×360=9 dots below Lower bound0.025 \times 360 = 9\text{ dots below Lower bound}0.025×360=9 dots above Upper bound0.025 \times 360 = 9\text{ dots above Upper bound}
    • Determining boundary values by counting extreme dots:
    • Counting the lowest 9 dots9\text{ dots} establishes the Lower bound: Lower=46\text{Lower} = 46
    • Counting the highest 9 dots9\text{ dots} establishes the Upper bound: Upper=93\text{Upper} = 93
    • Computing the estimated standard deviation:     s≈Upper−Lower4s \approx \frac{\text{Upper} - \text{Lower}}{4}s≈93−464s \approx \frac{93 - 46}{4}s≈474=11.75s \approx \frac{47}{4} = 11.75