###Question part 1
The constant/intercept is defined as the mean of the dependent variable when you set all of the independent variables in your model to zero.
In short: The intercept term relates to the prediction based on the fitted model, when all independent variables are set to zero. This prediction may be more or less good based on bias and noise.
Note that this only means $\bar {x} $ (the mean of some observed sample) is a predictor for the true mean of the entire population (it is not equal to it).
###Question part 2
So when in my last model, disp
and hp
are zero, the mean should be 30.7?! Obviously there's a distinction between "being zero" and "being included in the model/estimation".
The distinction is as following:
When disp is not in the model
then the intercept will refer to the mean of mpg for all values of disp.
When disp is in the model but set at zero
then the intercept will refer to the mean of mpg for the value of disp=0.
The image below will try to explain intuitively what this 'conditional on disp=0' means.
Note: I have augmented the data with values from another cars set to make the histograms better looking (From: https://github.com/RodolfoViana/exploratory-data-analysis-dataset-cars and http://www.rpubs.com/dksmith01/cars ).
- On the left you see the joint distribution of mpg and disp.
- On the right (in the margin) you see the marginal distribution of mpg only. This marginal distribution can be split up based on conditions on disp. In this image it is for sketched displacement below 100, between 100 and 300, and between 300 and 500 cubic inches.
The intercept (displacement = 0) would just be another condition (other than the three conditions sketched below). For cars it would not make physical practical sense to have the regressors set at zero (also note the broken gray line that I added, which is the model $\text{mgp}={270}/{\sqrt{\text{disp}}}$; this is probably a more realistic model). The position of the intercept is arbitrary and you can place it anywhere with a shift of variables (think for instance of the temperature scale where 0 degrees Fahrenheit/Kelvin/Celcius all mean something different).