Estimating Correlations Adjusted for Group Membership

Author

Dr. Joscelin Rocha-Hidalgo

Published

February 22, 2025

Buy me a coffeeBuy me a coffee


By Shannon Pileggi

This article discusses how to obtain accurate correlation estimates in the presence of underlying groups or related observations. It demonstrates the use of linear mixed models to adjust correlation estimates, providing sensible overall correlations across subgroups. The article includes applied examples using the Palmer penguins dataset and TidyTuesday Spotify songs to illustrate the approach.

  1. Link to article: https://www.pipinghotdata.com/posts/2021-10-11-estimating-correlations-adjusted-for-group-membership/

Scatterplots of body mass versus bill depth for Gentoo, Chinstrap, and Adelie penguins, each showing a strong positive correlation, and a combined plot for all species showing a negative correlation, with emoji reactions. Next to the plots is R code using compute_adj_corr to calculate an adjusted correlation, returning a value of 0.6207223.

Back to top