I am new to statistics and I am trying to understand the difference between ANOVA and linear regression. I am using R to explore this. I read various articles about why ANOVA and regression are different but still the same and how the can be visualised etc. I think I am pretty there but one bit is still missing.
I understand that ANOVA compares the variance within groups with the variance between groups to determine whether there is or is not a difference between any of the groups tested. (https://controls.engin.umich.edu/wiki/index.php/Factor_analysis_and_ANOVA)
For linear regression, I found a post in this forum which says that the same can be tested when we test whether b (slope) = 0. (Why is ANOVA taught / used as if it is a different research methodology compared to linear regression?)
For more than two groups I found a website stating:
The null hypothesis is: $\text{H}_0: µ_1 = µ_2 = µ_3$
The linear regression model is: $y = b_0 + b_1X_1 + b_2X_2 + e$
The output of the linear regression is, however, then the intercept for one group and the difference to this intercept for the other two groups. (http://www.real-statistics.com/multiple-regression/anova-using-regression/)
For me, this looks like that actually the intercepts are compared and not the slopes?
Another example where they compare intercepts rather than the slopes can be found here: (http://www.theanalysisfactor.com/why-anova-and-linear-regression-are-the-same-analysis/)
I am now struggling to understand what is actually compared in the linear regression? the slopes, the intercepts or both?