# Share of variance explained by individual predictor [duplicate]

I am interested in how to calculate portion of explained variance of each individual independend variable in regression equation.

So regression model is $y=b_{0}+b_{1}x_{1}+...b_{n}x_{k}+\epsilon$ and suppose I even know true values of $b$ and have data for all $x$. It is clear how to find portion of variance explained by $\epsilon$ (just $\frac{var(\epsilon)}{var(y)}$), but how to make this trick to each $x$ if they are correlated? So the problem as I see is that additional covariations between $x$'s do not let repeat the technick applied to disturbance term because each $x_{i}$ contribute to y variation through var(x) as well as throught $cov(x_{i},x_{-i})$.

The problem I am interested in has been rised beofre in topic How to split r-squared between predictor variables in multiple regression?

In order to handle with this problem in matlab function anova(reg) can be used where reg is an fitlm object. But I am strongly interested in how to make these calculations by hand.

Will be very greatfull for help!

One common method is to add regressors to the model one by one and record the increase in $R^2$ as each regressor is added. Since this value depends on the regressors already in the model, one needs to do this for every possible order in which regressors can enter the model, and then average over orders. This is feasible for small models but becomes computationally prohibitive for large models, since the number of possible orders is $p!$ for $p$ predictors.