Meaning of & intuition behind predictors being fixed in linear regression My question is a bit naive. I'm trying to get the exact & clear meaning of the phrase "predictor variables are fixed and not random in linear regression".
According to my understanding, fixed means that we pre-set values of predictors in an experiment and then observe y for those values;
whereas random means that while conducting an experiment we first measure the predictor variables and then measure the y (we can do this at different time points to get different Xs and Ys or a dataset).
However even with this understanding of mine (which I am not sure is right), I am not able to understand clearly why do we require the predictive variables to be fixed and not random.
What would go wrong if we observe or measure the Xs instead of keeping them pre-set?
TLDR: What is the meaning of fixed X and also the need to keep them fixed?
 A: This terminology refers to whether we want some coefficient in a regression model to be similar but vary across some categories. E.g. if you want to model the relationship between outside temperature and how many minutes flights will be delayed by, you can do a number of things:

*

*assume there is a single slope for all flights $i=1,\ldots,I$, so something like $\text{delay}_i = \text{intercept} + \text{slope} * \text{temperature}_i + \epsilon_i$ (we would call that a fixed effect),

*assume that this relationship is different and unrelated for every airport $j=1,\ldots,J$, i.e. $\text{delay}_i = \text{intercept} + \sum_{j=1}^J 1\{\text{airport}_i=j\} *\text{slope}_j *  \text{temperature}_i + \epsilon_i$ (we would say that we have separate fixed effects for every airport, or

*assume that this relationship is different across airports, but varies across airport according to some distribution (e.g. a normal distribution) so that $\text{delay}_i = \text{intercept} + \sum_{j=1}^J 1\{\text{airport}_i=j\} *\text{slope}_j *  \text{temperature}_i + \epsilon_i$ with $\text{slope}_j \sim N(0, \tau^2)$ (we would say that we have a random airport effect on the slope term). Next, you could of course also have a random airport effect on the intercept (or a fixed airport main effect), too (after all some airport just always have longer delays).

Option 3 has the effect that we borrow information from other airports so that airports with few participants have their slope estimates pulled towards the (weighted) average of the slopes for all the airports.
