Partial correlation helps you understand the direct link between two variables by removing the influence of other factors. Use this method when you suspect that third-party variables, such as age, BMI, or dosage, are skewing your results and you need to isolate the net association between your variables of interest.
Understanding Net Relationships
In many datasets, two variables might appear related simply because they are both influenced by a third, hidden factor. Partial correlation allows you to isolate the specific link between your variables of interest by holding other factors constant.
By applying this method, you can verify whether a correlation remains statistically significant after accounting for potential interference. This is essential for distinguishing between direct associations and results that are merely artifacts of shared influences.
How It Works
Lattice uses a statistical process that calculates the residuals of your primary variables after they have been adjusted for the covariates you provide. It then computes the correlation on these residuals.
The output provides the partial correlation coefficient (the net association), the corresponding p-value, and confidence intervals to ensure your results are reliable. It also includes a comparison to the 'zero-order' correlation—the raw relationship before any adjustments were made.
Interpreting the Findings
Beyond just identifying if a relationship exists, this tool calculates the 'absorbed percentage.' This metric tells you how much of the initial, raw correlation is accounted for by your chosen control variables.
A low absorbed percentage suggests that your variables have a stable, direct relationship that persists regardless of the control factors. A high percentage indicates that the control variables are playing a major role in the observed data patterns, helping you refine your focus for further analysis.
When to Refine Your Model
If the partial correlation is no longer significant after controlling for covariates, it is a sign that the original relationship was likely driven by those extra factors. In this case, you may need to expand your dataset or re-evaluate which variables you are measuring.
Conversely, if the partial correlation remains strong and significant, you have evidence of a robust direct link. This is often the ideal starting point for moving into more advanced tasks like multivariate linear regression.
1 · Intent → method
An LLM picks partial_correlation from a fixed catalog.
2 · Method → numbers
Deterministic Python engine runs the math. Same input → same output.
3 · Numbers → plain language
A second LLM translates the result into your domain’s vocabulary.
Why is partial correlation different from regular correlation?
Regular correlation measures the relationship between two variables as they are. Partial correlation adds a 'control' step, mathematically stripping away the influence of covariates to show you the net relationship that remains.
What does the 'absorbed percentage' tell me?
The absorbed percentage shows how much of the original relationship is explained by the covariates you chose. If this value is high (over 50%), it suggests that the covariates are the primary drivers of the observed link, rather than the variables themselves.
Tool input schema
Schema for partial_correlation not exported yet (run pnpm export:registry).