Compute and correct correlation significance inflation
MetaData Scientist · Technical ScreenLast updated
This question tests the understanding of how multiple hypothesis testing increases the risk of false positives (Type I error) in high-dimensional correlation matrices and requires the application of correction methods to maintain statistical integrity.
Scenario
You are analyzing user engagement logs from a large social media platform. You have a dataset with N = 1,000,000 unique users and P = 5,000 different engagement metrics (e.g., clicks, shares, time spent, specific feature interactions). You are tasked with identifying which of these P metrics are significantly correlated with a core business KPI (e.g., user retention score) at a significance level of alpha = 0.05.
Task
- Explain why calculating 5,000 individual Pearson correlation coefficients and using a p-value threshold of 0.05 without adjustments leads to 'significance inflation.'
- Calculate the expected number of false positives (Type I errors) if all metrics are truly independent of the KPI.
- Propose a method to control for the family-wise error rate (FWER) and a method to control for the false discovery rate (FDR). Describe the trade-offs between them in this context.
- If the correlation between a metric and the KPI disappears when conditioning on a latent variable (e.g., user account age), how would you mathematically determine if the original correlation was spurious using partial correlation?
Example
Consider a case where P = 100 tests are conducted. If alpha = 0.05, the expected number of false positives is 100 * 0.05 = 5. Even if no true relationship exists between any metric and the KPI, you would likely declare 5 metrics as 'significant' by pure chance.
Hints
Hint 1
Consider the cumulative probability of at least one Type I error occurring across P independent tests, given by 1 - (1 - alpha)^P.
Hint 2
Think about the Bonferroni correction for FWER and the Benjamini-Hochberg procedure for FDR.
Hint 3
Recall that the partial correlation between X and Y given Z can be calculated using the formula: corr(X,Y|Z) = (corr(X,Y) - corr(X,Z)*corr(Y,Z)) / sqrt((1 - corr(X,Z)^2) * (1 - corr(Y,Z)^2)).
Follow-up questions
- How does the assumption of independence between the 5,000 metrics impact your choice of multiple testing correction?
- If your metrics are highly collinear (e.g., many metrics track similar user behaviors), how would that change your strategy for identifying important features?
- In a production environment where you need to deploy these metrics into an automated bidding model, what risks does over-relying on statistical significance present?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.