# Covariates and degrees of freedom

Consider a problem, when one is interested in finding influence of variable set {X} on Y (assuming reverse causal relation is infeasible), when confounding influences from a set of variables {Z} are present.

I am familiar with two approches to disentangle effect of {Z} on Y from effect of {X}:

1. Partial correlation / residualization in a "fixed" effect model, when the number of covariates $p_Z =$ |{Z}| is small compared to the number of available samples, $p_Z \ll N$, as by fitting multiple regressions one removes degrees of freedom, and given linearly independent factors Z, the degrees of freedom will be depleted as $p_Z$ approaches $N$.

2. Expressing correlation structure of confounding effects as "random" effect, which requires $p_Z > N$ to estimate covariance matrix.

Question: What are alternative approaches? Are there approaches that work for $p_Z \approx N$ or all mentioned regimes? Have sparse regression models been applied to this problem?