Week 04 - Associations

Prof. C. Austin Davis

Spring 2025

Roadmap for today

  • Quiz
  • At home problems: does UCB discriminate
  • Weather and energy: extremes and spread
  • Recap of descriptive statistics
  • Covariance, correlation, and associations
  • Preview of next time

Quiz

Does UC Berkeley discriminate?

Female applicants by department

Admission rate by department

Admissions by department

Adm. rates by department and gender

Does UC Berkeley discriminate?

Well, maybe. Now we know where to look.

Extremes and spread

Our tools

Measuring the extremes

  • min()
  • max()
  • quantile()

Variance and standard deviation

  • Definition
  • var()

Variance at the dinner table

  • Which table has the higher variance in ages?
    • A family: 1, 37, 37, 60, 65
    • Friends from school: 37, 37, 41, 42, 43

What does variance look like

Scale matters

Variance at the dinner table

  • Which table has the higher variance in income?
    • Civil servants: 60k, 80k, 90k, 110k, 120k
    • CEOs: 6m, 8m, 9m, 11m, 12m

Is weather becoming more extreme?

Variance in local rainfall

Energy use at US Embassies

Simulated energy use by month

Recap of descriptive statistics

Summarizing distributions

Tools

  • Histogram or density
  • Percentiles or CDF
  • Frequency tables

Applications

  • Air quality in Delhi
  • US income distribution
  • Traumatic experiences in refugee setting

Central tendency

Tools

  • Mean
  • Median

Applications

  • Application and admission rates to UCB
  • US income distribution

Extreme values and spread

Tools

  • Min, max
  • Percentiles
  • Variance

Applications

  • Extreme weather days
  • Energy efficiency at US embassies

Associations

What are associations?

As the values of one variable change, do we see systematic changes in another?

  • Mean admission by gender & department
  • Distribution of AQI by month
  • Percentiles of PHQ-9 scores by residence

So far, at least one variable has been categorical

  • Comparing summary statistics across groups
  • New approaches suitable for continuous variables

Our tools

Measuring associations

  • cov()
  • cor()

Covariance

Covariance

Covariance

Covariance

Covariance

Correlation

Preview of next time

Relationships between variables

Questions to ponder

How could you draw a line to summarize the relationship between math and language scores?