BM 4&5

DATA ANALYSIS - AVERAGES AND MEASURES OF DISPERSION

Lecture Overview

  • Course: BM & EBL Year 2
  • Instructor: Kelebogile Kenalemang

OUTLINE

  • Basic summary measures
  • Measures of Location
  • The nature of variation
  • Measuring variation
  • Interpreting the measures

Measures of Location / Measures of Central Tendency

  • A measure of central tendency refers to a value that represents the typical or "average" value in a data set.
  • The purpose of central tendency measures is to identify the location at the center of a data set.
  • There are three common measures of Central Tendency:
    • Mean
    • Median
    • Mode

Mean

  • The mean (also called the average) is calculated as follows:
    • The mean is the sum of all data values divided by the number of values in the data set.
    • Formula for Sample Mean:
      x=∑xnx = \frac{\sum x}{n}
      where:
    • xx = sample mean
    • ∑x\sum x = sum of all values
    • nn = number of values in the sample
    • Formula for Population Mean:
      μ=∑XN\mu = \frac{\sum X}{N}
      where:
    • μ\mu = population mean
    • ∑X\sum X = sum of all values in the population
    • NN = number of values in the population
Example 1: Product Demand
  • Data Set: 3, 12, 7, 17, 3, 14, 9, 6, 11, 10, 1, 4, 19, 7, 15, 6, 9, 12, 12, 8
  • Task: Calculate the sample mean for this data set.
Example 2: Employee Salaries (Basic Calculation)
  • Salaries (in thousands): 8, 12, 15, 10, 9, 18, 14, 11, 13, 10, 12, 16
  • Task: Calculate the sample mean salary for these employees.
  • Follow-up Question: Should the mean be used as a basis for salary raises? Why or why not?
Example 3: Exam Scores (Interpreting Outliers)
  • Scores: 45, 55, 60, 50, 72, 75, 80, 48, 55, 60, 65, 58, 50, 100, 52
  • Task: Calculate the sample mean test score. Follow-up Questions:
    1. How does the high score (100) affect the mean?
    2. What would be a better measure of typical performance without the impact of extremes?
Example 4: Real Estate Prices (Skewed Data)
  • Prices (in millions of Pula): 1.5, 2.0, 1.8, 1.2, 1.7, 2.2, 2.0, 1.9, 3.5, 1.6, 2.1, 10.5
  • Task: Calculate the sample mean selling price.
  • Follow-up Challenge: Given the outlier (10.5M Pula), should the mean or another measure be used? Why?
Calculating the Arithmetic Mean for a Frequency Distribution
  • The arithmetic mean for a frequency distribution is calculated using:
    • Formula:
      x=∑(f⋅x)∑fx = \frac{\sum (f \cdot x)}{\sum f}
      where:
    • ff = frequency
    • xx = respective data values
Example: Ungrouped Frequency Table


  • Data: Daily sales of a double-glazing company

No. of SalesFrequency
23
37
49
56
65
72
81

Class Activity Example 1: Restaurant Orders Analysis

  • Task: Calculate the mean number of orders placed per hour.
    • Data:
      | Orders/hour (x) | Frequency (f) |
      |-----------------|---------------|
      | 5 | 3 |
      | 10 | 6 |
      | 15 | 8 |
      | 20 | 5 |
      | 25 | 4 |
Task: Calculating the Arithmetic Mean for a Grouped Frequency Table


  • Daily Demand Frequency:

Class IntervalsFrequency
0-44
5-98
10-146
15-202
Class Activity: Delivery Delays Impact on Customer Satisfaction
  • Task: Calculate the mean delivery delay time.
    • Data:
      | Delay Time (Hours) | Frequency (f) |
      |--------------------|---------------|
      | 0 | 10 |
      | 1 | 15 |
      | 2 | 12 |
      | 3 | 8 |
      | 4 | 5 |
Class Activity: Employee Working Hours Analysis


  • Data (Class Intervals):

Weekly Working HoursFrequency (f)
30 – 344
35 – 396
40 – 4410
45 – 498
50 – 543
  • Task: Calculate the mean weekly working hours of employees using the midpoint method.
  • Median

    • The median provides a better central measure than the mean in presence of outliers.
    • To find the median:
      • Arrange data in ascending order and select the middle value.
    • Example: Find the median for:
      • Data Set: 3, 12, 7, 17, 3, 14, 9, 6, 11, 10, 1, 4, 19, 7, 15, 6, 9, 12, 12, 8
    Class Activity Example 1: Exam Scores Analysis
    • Scores: 48, 55, 62, 45, 71, 85, 90, 60, 77, 52, 68, 50, 81, 49, 66
    • Task: Find the median score for this data set.
    • Follow-up Interpretations:
      1. Why might the median serve as a better measure of performance than the mean?
      2. If the highest score (90) increased to 100, how would this impact the median and mean?
    Class Activity Example 2: Median for Grouped Data (Class Intervals)


    • Scenario: Income Distribution

      Class Intervals:

    Salary (Pula)Frequency (f)
    2500 – 29995
    3000 – 34997
    3500 – 399912
    4000 – 44998
    4500 – 49994
  • Task: Determine the median salary range using the cumulative frequency method.
  • Mode

    • The mode is the value that appears most frequently in a data set.
    • Applicability: Can be used for both categorical and numerical data.
    Mode of Coffee Orders Example


    • Coffee Orders Data:

    Coffee TypeNumber of Orders
    Cappuccino25
    Latte40
    Espresso18
    Mocha35
    Americano40
  • Task: Identify the mode of orders.
  • Interpretation: Analyze what the mode indicates about customer preferences and its implications for stocking strategies.
  • Example: Travel to Work Survey Mode


    • Travel Modes and Frequencies:

    Mode of TravelFrequency
    Car9
    Bus4
    Cycle3
    Walk2
    Train2
    Class Activity Scenario: Best-Selling Shoe Size
    • Shoe Sizes Data:
      • Sizes recorded from 30 customers.
    • Task: Determine the mode(s) of shoe sizes.
    • Interpretation:
      • Which sizes should be prioritized for stock?
      • Which sizes might be least discounted during promotions?

    Measures of Dispersion / Spread / Variability

    • Purpose of Measure of Dispersion: Provides insights into the spread or distribution of values in the data set.
    • A high dispersion indicates widely scattered values, while low dispersion indicates values are closely packed.
    Main Measures of Dispersion
    1. The Range
    2. Quartiles and Semi-Interquartile Range
    3. Mean Deviation
    4. Variance and Standard Deviation
    5. Coefficient of Variation

    The Range

    • The Range is calculated as:
      • Formula:
        Range=Highestextvalue−LowestextvalueRange = Highest ext{ value} - Lowest ext{ value}
    • Example: Calculate the range:
      • Data Set: 4, 8, 7, 3, 5, 16, 24, 5, 6, 4, 3
    Range in Exam Scores Scenario: Comparing Classes
    • Scores for Class A: 45, 50, 52, 49, 60, 55, 47, 51, 53, 56
    • Scores for Class B: 30, 85, 55, 40, 90, 70, 65, 50, 75, 80
    • Tasks:
      1. Calculate the range for both classes.
      2. Determine which class has more spread-out scores and the implications of consistency in student performance.

    Quartiles and Semi-Interquartile Range

    • Definition: Quartiles divide a data set into four equal sized groups.
    • Key Quartiles:
      • Lower Quartile (Q1): Value below which 25% of data falls.
      • Median (Q2): Middle value of data set.
      • Upper Quartile (Q3): Value above which 25% of data falls.
    Example: Calculate Quartiles
    • Data Set: 4, 8, 7, 3, 5, 16, 24, 5, 6, 4, 3
    • Calculation of Quartiles:
      • Q1=14×nQ1 = \frac{1}{4} \times n
      • Q2=12×nQ2 = \frac{1}{2} \times n
      • Q3=34×nQ3 = \frac{3}{4} \times n

    Mean Deviation

    • Definition: Mean deviation measures the average of differences between values in distribution and the arithmetic mean.
    • Formula:
      Meanextdeviation=∑f∣x−xˉ∣∑fMean ext{ deviation} = \frac{\sum f |x - x̄|}{\sum f}
    Class Exercise: Overtime Worked by Employees


    • Data: Hours worked in a quarter by 60 employees:

    HoursFrequency
    0-103
    10-206
    20-3011
    30-4015
    40-5012
    50-607
    60-706
  • Task: Calculate mean deviation.
  • Variance

    • The variance quantifies the degree to which each number in the data set differs from the mean.
    • Calculations:
      • For Ungrouped Data:
        σ2=∑(x−xˉ)2n\sigma^2 = \frac{\sum (x - x̄)^2}{n}
      • For Grouped Data:
        σ2=∑f(x−xˉ)2∑f\sigma^2 = \frac{\sum f(x - x̄)^2}{\sum f}
    Class Exercise: Calculate Variance and Standard Deviation
    • Task: Calculate variance and standard deviation for the frequency distribution of hours (as per earlier exercises).

    Coefficient of Variation

    • Definition: A normalized measure of the dispersion of a probability distribution, comparing the standard deviation to the mean.
    • Formula:
      CV=StandardextDeviationMeanCV = \frac{Standard ext{ Deviation}}{Mean}
    • A higher CV indicates greater variability.
    Example: Comparing Data Sets A and B
    • Data Set A:
      • Mean = 120, Standard Deviation = 50
    • Data Set B:
      • Mean = 125, Standard Deviation = 51
    • Task: Calculate CV and provide a comparison of variability.
    Class Exercise: Hospital Waiting Times
    • Scenario: Comparing waiting times for two operations:
      • Bypass Surgery: Mean = 17 weeks, SD = 6 weeks
      • Hip Replacement: Mean = 11 months, SD = 1 month
    • Task: Determine which operation has the highest variability.