Test of correlation

Statistical Thinking in Python (Part 2)

Justin Bois

Lecturer at the California Institute of Technology

2008 US swing state election results

ch4-2.002.png

1 Data retrieved from Data.gov (https://www.data.gov/)
Statistical Thinking in Python (Part 2)

Hypothesis test of correlation

  • Posit null hypothesis: the two variables are completely uncorrelated
  • Simulate data assuming null hypothesis is true
  • Use Pearson correlation, $\rho$, as test statistic
  • Compute p-value as fraction of replicates that have $\rho$ at least as large as observed.
Statistical Thinking in Python (Part 2)

More populous counties voted for Obama

ch4-2.009.png

Statistical Thinking in Python (Part 2)

More populous counties voted for Obama

ch4-2.010.png

Statistical Thinking in Python (Part 2)

Let's practice!

Statistical Thinking in Python (Part 2)

Preparing Video For Download...