Welcome to Parametric and Non-Parametric Tests of Independence!

In your CFA journey so far, you’ve learned how to describe data and test hypotheses about a single mean or variance. But in the real world of finance, we rarely look at one thing in isolation. We want to know: Is the performance of a stock related to its industry? Does a CEO’s education level affect company returns?

In this chapter, we explore how to test if two variables are independent (meaning they have no relationship) or dependent (meaning they do). We will look at two main tools: the Chi-Square Test and Spearman’s Rank Correlation. Don’t worry if these sound like a mouthful—we’ll break them down piece by piece!

Quick Review: What does "Independence" mean?
If two events are independent, the occurrence of one tells you nothing about the probability of the other. For example, flipping a coin and the weather in London are independent. However, interest rates and bond prices are dependent.


1. Parametric vs. Non-Parametric Tests: The Big Picture

Before we dive into the specific tests, we need to understand the two "families" of statistical tests.

Parametric Tests

These tests make strict assumptions about the underlying data. Usually, they assume the data follows a specific distribution (like the Normal Distribution) and use parameters like the mean and variance. Think of these like a strict baking recipe—if you don’t have the exact ingredients, the cake won't rise.

Non-Parametric Tests

These are more flexible. They don’t require the data to be normally distributed. They are often used when we have small sample sizes, outliers, or data that is ranked (like "1st place, 2nd place") rather than precise measurements. Think of these like a "taco bar"—you can swap ingredients and it still works!

Key Takeaway: We use non-parametric tests when our data is "messy" or doesn't meet the strict requirements of parametric tests.


2. The Chi-Square (\(\chi^2\)) Test of Independence

The Chi-Square test is used when we have categorical data. This means our data is sorted into groups or "buckets" rather than being continuous numbers. For example, sorting companies by Sector (Tech, Energy, Finance) and Dividend Policy (Pays Dividends, No Dividends).

Contingency Tables

To perform this test, we use a contingency table (also called a two-way table). It shows the counts (frequencies) for two categorical variables at the same time.

The Hypothesis

Null Hypothesis (\(H_0\)): The two variables are independent (no relationship).
Alternative Hypothesis (\(H_a\)): The two variables are dependent (there is a relationship).

Calculating the Test Statistic

The Chi-Square statistic measures the difference between what we actually observed (\(O\)) and what we would expect (\(E\)) to see if the variables were perfectly independent.

The formula is:
\( \chi^2 = \sum \frac{(O - E)^2}{E} \)

Step-by-Step Process:
1. Calculate Expected Values (\(E\)): For each cell in your table, use this trick:
\( E = \frac{(\text{Row Total} \times \text{Column Total})}{\text{Grand Total}} \)
2. Find the Difference: For each cell, subtract the expected value from the observed value (\(O - E\)).
3. Square and Divide: Square that difference and divide by the expected value.
4. Sum them up: Add those values together for all cells to get your \(\chi^2\) statistic.

Degrees of Freedom (\(df\))

For a Chi-Square test of independence, the degrees of freedom are calculated as:
\( df = (r - 1) \times (c - 1) \)
Where \(r\) is the number of rows and \(c\) is the number of columns.

Did you know? The Chi-Square distribution is always positive and skewed to the right. As the degrees of freedom increase, it starts to look more like a normal distribution!

Key Takeaway: If the calculated \(\chi^2\) is much larger than the "critical value" from the table, we reject the null hypothesis and conclude that the variables are related.


3. Spearman Rank Correlation Coefficient (\(r_s\))

Sometimes we want to know the strength of a relationship, but our data is ordinal (ranked) or has extreme outliers that would ruin a standard correlation calculation. This is where Spearman’s Rank Correlation comes in.

Analogy: Imagine two judges ranking 10 contestants in a talent show. Even if the judges don't give the exact same scores, if they both agree that Contestant A is better than Contestant B, their ranks will be correlated.

Why use it?

  • It is a non-parametric alternative to the Pearson correlation.
  • It is used when data is non-linear but still follows a trend (monotonic).
  • It is robust to outliers because it looks at the order of data, not the actual values.

How to calculate it:

1. Rank the data for both variables from smallest to largest (or largest to smallest).
2. Calculate the difference (\(d_i\)) between the ranks for each pair.
3. Use the formula:
\( r_s = 1 - \frac{6 \sum d_i^2}{n(n^2 - 1)} \)

Interpreting the Result:
The value of \(r_s\) will always be between -1 and +1.
- +1: Perfect positive rank correlation (as one rank goes up, the other always goes up).
- -1: Perfect negative rank correlation.
- 0: No relationship between the ranks.

Common Mistake: Don't forget the "6" in the numerator! It's a constant part of the formula, regardless of your sample size.

Key Takeaway: Spearman's Rank Correlation is the go-to tool when your data isn't normally distributed or when you are dealing with rankings rather than raw measurements.


4. When to use Non-Parametric Tests? (Quick Guide)

On the CFA exam, you might be asked to identify when a non-parametric test is more appropriate than a parametric one. Keep these four scenarios in mind:

  1. Data is Categorical: Use Chi-Square when you are counting things in buckets.
  2. Data is Ordinal (Ranked): Use Spearman Rank Correlation.
  3. Small Sample Size: When your sample is too small to assume a normal distribution.
  4. Extreme Outliers: When a few crazy data points would pull a mean or correlation too far in one direction.

Don't worry if this seems tricky at first! Just remember: Parametric = Precise/Strict, Non-Parametric = Ranks/Flexible.


Summary & Quick Review Box

Chi-Square Test: Tests for independence between two categorical variables using a contingency table. Uses \(df = (r-1)(c-1)\).

Spearman Rank Correlation: Measures the strength of the relationship between ranked data. Ranges from -1 to +1.

Independence: The null hypothesis usually states there is no relationship. If our test statistic is high, we "fire" (reject) the null hypothesis!

Check your understanding:
If you are comparing "Analyst Rating" (Buy/Hold/Sell) and "Industry" (Tech/Retail), which test would you use?
Answer: Chi-Square Test of Independence (because these are categories!).