Descriptive Statistics, Z-Scores, and Data Visualization

Measures of Central Tendency and Dispersion

  • Mode:

    • Represents the most frequent value in a dataset.

    • Identifies the specific value that a random variable or observation is most likely to take.

  • Mean and Expected Value:

    • The arithmetic mean (xˉ\bar{x}) can produce a value that does not exist as an actual observation within the dataset (e.g., a mean of 3.23.2 in a dataset composed strictly of integers).

    • The expected value of a variable, denoted as E(X)E(X), is mathematically equal to the population mean (xˉ\bar{x}).

  • Quartiles and Interquartile Range:

    • Quartiles divide an ordered dataset into four equal parts:

      • First Quartile (Q1Q_1): 25th25^{\text{th}} percentile.

      • Second Quartile (Q2Q_2): 50th50^{\text{th}} percentile (also the median).

      • Third Quartile (Q3Q_3): 75th75^{\text{th}} percentile.

      • Fourth Quartile (Q4Q_4): 100th100^{\text{th}} percentile.

    • Interquartile Range (IQR): Represents the spread of the middle 50%50\% of the data and is defined as the difference between the third and first quartiles:         IQR=Q3−Q1\text{IQR} = Q_3 - Q_1

  • Comparing Dispersion (City Price Examples):

    • Two distinct datasets can share the exact same mean while exhibiting completely different distributions.

    • City A (CTA) Prices: Mean = 100100, Standard Deviation = 55 (or 11).

    • City B (CTB) Prices: Mean = 100100, Standard Deviation = 5050.

    • Even though both cities have a mean price of 100100, the standard deviation of City B is 1010 times larger than that of City A, indicating significantly higher price dispersion.

  • Standard Deviation and Variance:

    • Standard Deviation (ss or σ\sigma): Defined as the average distance of observation points from the mean.

    • Variance (s2s^2 or σ2\sigma^2): Mathematically defined as the square of the standard deviation (standard deviation without the square root). While useful algebraically, variance is intuitively harder to interpret due to squared units.

    • Unit Consistency: Standard deviation is always expressed in the exact same unit of measurement as the original variable (e.g., dollars, euros, forints, miles, kilometers, feet, or centimeters).

    • Interpretation: A larger standard deviation corresponds directly to greater variability and dispersion among values.

Skewness and Z-Score Standardization

  • Distribution Skewness:

    • Symmetric Distribution: Observations are distributed evenly on both sides of the mean.

    • Right-Skewed Distribution (Positive Skew): Contains extremely high values extending the right tail. In a right-skewed distribution, the mean is greater than the median:         Mean>Median\text{Mean} > \text{Median}

    • Left-Skewed Distribution (Negative Skew): Contains extremely low values extending the left tail. In a left-skewed distribution, the median is greater than the mean:         Median>Mean\text{Median} > \text{Mean}

  • Z-Scores (Standardization):

    • Definition: Standardizing a variable converts raw observations into Z-scores, expressing how many standard deviations an individual observation lies above or below the mean.

    • Formula:         z=x−xˉsz = \frac{x - \bar{x}}{s}         where xx is the individual observation, xˉ\bar{x} is the variable mean, and ss is the standard deviation.

    • Scale Invariance: Subtracting the mean and dividing by the standard deviation strips away the original scale and physical unit of measurement.

    • Cross-Variable Comparison: Enables direct comparison between variables measured on entirely different scales (e.g., comparing height in centimeters to weight in kilograms, or price to distance).

    • Interpretation of Values:

      • A Z-score of 1.51.5 indicates that the observation is 1.51.5 standard deviations above the mean.

      • A Z-score of −2.0-2.0 indicates that the observation is 2.02.0 standard deviations below the mean.

  • Detailed Calculation Example:

    • Context: History exam scores are normally distributed with a mean of 7272 (μ=72\mu = 72) and a standard deviation of 88 (σ=8\sigma = 8).

    • Student A Score (xA=88x_A = 88):         zA=88−728=168=2.0z_A = \frac{88 - 72}{8} = \frac{16}{8} = 2.0         Interpretation: Student A scored 2.02.0 standard deviations above the class mean.

    • Student B Score (xB=60x_B = 60):         zB=60−728=−128=−1.5z_B = \frac{60 - 72}{8} = \frac{-12}{8} = -1.5         Interpretation: Student B scored 1.51.5 standard deviations below the class mean.

Percentiles, Z-Tables, and Descriptive Statistics

  • Evaluating Performance with Z-Scores:

    • Using a standard normal Z-table (evaluated at a standard 0.050.05 significance benchmark):

      • A Z-score of −1.5-1.5 corresponds to performing better than approximately 6%6\% of peers.

      • A Z-score of 2.02.0 corresponds to performing better than approximately 97%97\% of peers.

    • Key Advantage: Z-scores allow determination of relative rank and relative performance without needing knowledge of the raw mean, total scale, or exact sample size.

  • Summary Statistics Overview:

    • Central Tendency: Mean, Median, Mode.

    • Spread / Dispersion:

      • Range: Difference between maximum and minimum values:             Range=Max−Min\text{Range} = \text{Max} - \text{Min}

      • Interquartile Range (IQR): Q3−Q1Q_3 - Q_1

      • Standard Deviation (ss) and Variance (s2s^2).

    • Skewness: Captures asymmetry and structural differences between the mean, median, and variance.

    • Sample Size (nn): Denotes the total number of valid observations in empirical dataset analysis.

Distribution Shapes, Histograms, and Density Plots

  • Common Distribution Types:

    • Log-Normal Distribution: Extremely common for positive-bounded economic measures like income or GDP. Because income cannot fall below zero, high earners create a long right tail.

    • Uniform Distribution: Observations are spread evenly across the domain.

    • Power Law Distribution: Highly skewed distribution with heavy tails.

  • Histogram Structural Components:

    • Peaks: Represent the mode (the most frequently observed values or intervals).

    • Center: Represents where the typical mass of observations is located.

    • Tails: Indicate skewness (e.g., right-hand tail extending toward large values).

    • Outliers / Extreme Values: Observations located far away from the primary data cluster (e.g., an observation near 400400).

  • Histograms vs. Density Plots:

    • Density Plot: Provides a smooth continuous curve fitting the continuous shape of data distribution.

    • Histogram: Uses discrete vertical bars to group observations into bins.

    • Precision Comparison: Histograms display more granular detail and precise distributional structure compared to density plots, which present a smoothed approximation of the raw shape.

Histogram Bin Sizing and Outlier Management

  • Bin Sizing Considerations:

    • Overly Narrow Bins: Produce excessively detailed, noisy, visually cluttered histograms that obscure underlying patterns.

    • Overly Wide Bins: Group data into too few categories (e.g., 33 bins), concealing true distributional features.

    • Optimal Binning: Balances detail and visual smooth readability.

  • Data Types and Visualization Structure:

    • Qualitative (Categorical) Variables: Represent discrete categories (e.g., eye color). Bins are distinct, and bars typically do not touch.

    • Quantitative (Continuous) Variables: Continuous numeric scales where histogram bars touch one another.

  • Step-by-Step Procedure for Managing Outliers:

    1. Detection: Graphically or statistically identify values lying far outside expected bounds (e.g., detecting a weight entry of 500 kg500\,\text{kg} or 5000 kg5000\,\text{kg} among baseline averages of 70 kg70\,\text{kg}).

    2. Error Assessment: Determine if the outlier is an input error (e.g., an extra zero making 5000 kg5000\,\text{kg}, which is impossible and must be dropped) or a legitimate extreme value (500 kg500\,\text{kg}, which is technically possible).

    3. Retention or Exclusion Decision: Evaluate whether retaining or dropping the observation aligns with the research question.

    4. Transparency Requirement: Researchers must explicitly state all data cleaning, filtering, and dropping choices to expose potential sample bias.

Empirical Application: Vienna vs. London Hotel Dataset

  • Sample Cleaning Process (Vienna Hotels Dataset):

    • Initial Uncleaned Dataset: 428428 total accommodation observations recorded on a single weeknight in November 2017.

    • Restriction to Hotels Only: Excluding non-hotel accommodations (villas, apartments, hostels, Airbnbs) removes approximately 200200 observations, reducing the sample from 428428 to ≈228\approx 228.

    • Star Rating & Price Error Filter: Restricting sample to 3-star and 4-star hotels drops an invalid price outlier, reducing the sample from 218218 to 217217 observations.

    • Distance Filter: Restricting distance to the city center removes 1010 additional observations.

    • Final Cleaned Sample Size: 207207 observations remaining out of the original 428428.

  • Comparing Distributions (London vs. Vienna Accommodations):

    • Sample Size Difference: London features roughly twice as many eligible hotel accommodations meeting criteria as Vienna.

    • London Price Distribution: Concentrated toward higher values, with the majority of prices falling between 150150 and 250250 currency units. Maximum value reaches 491491.

    • Vienna Price Distribution: Concentrated toward lower values, with the majority of prices falling between 5050 and 150150 currency units. Maximum value reaches 383383.

    • Comparative Conclusion: London is on average more expensive than Vienna, displaying higher overall mean and median prices despite London containing the single absolute lowest minimum price point.

Guidelines for Data Visualization and Summary Reports

  • Data Visualization Rules:

    • Single Focus: Each individual chart or graph must answer exactly one clear research question.

    • Aesthetic Clarity: Select distinct, accessible color palettes that accommodate colorblind readers.

    • Mandatory Graphic Requirements:

      1. Title / Name: Every chart must have a clear descriptive name.

      2. Horizontal (XX) Axis Label: Explicitly named variable and measurement scale.

      3. Vertical (YY) Axis Label: Explicitly named variable (e.g., frequency or count).

      4. Scale Markings: Clear units and distance intervals along both axes.

      5. Legend: Complete legend defining all distinct color groupings or series.

  • Core Summary Statistics Checklist:

    • Categorical / Qualitative Variables: Evaluated using relative frequencies.

    • Continuous / Quantitative Variables: Evaluated using histograms, density plots, and descriptive statistics tables.

    • Descriptive Statistics Contents: Mean, Median, Standard Deviation, Range (Min and Max), Interquartile Range, and total valid sample size (nn).