# What does a random sample mean in linear regression? [duplicate]

For linear regression

$$y_i=x_i^T \beta+\epsilon_i$$

what is been sampled? Sometimes I see that our sample is $$\{X_1,X_2,\ldots,X_n\}$$ while other times I see that our sample is $$\{Y_1,Y_2,\ldots,Y_n\}$$ where each $$Y_i$$ and $$X_i$$ are random variables.

Few times I saw $$X_1,\ldots,X_n \, \stackrel{i.i.d.}{\sim} f$$ and sometimes $$X_1,\ldots,X_n \,|\, p \stackrel{i.i.d.}{\sim} p,\quad p\in \Pi$$.

Are we sampling $$y_i$$ or $$x_i^T$$ or both?

I am specifically focusing on posterior consistency in https://www.dianacai.com/blog/2021/02/14/schwartz-theorem-posterior-consistency/#:~:text=Consistency%20serves%20a%20check%20on,around%20the%20true%20generating%20value

where we study the convergence of the sequence of posteriors $$\{ Π(.|X1,...,X_n) \}$$. Does $$X_i$$ here refer to both $$y_i$$ and $$x^T_i$$ or just $$x^T_i$$?

• @Xi'an, My question is mainly about consistency i.e. the study of the convergence of the posterior sequence $\Pi(.|X_1,...,X_n)$. Does $X_i$ here refer to both $y_i$ and $x_i^T$ or just $x_i^T$? Source: dianacai.com/blog/2021/02/14/….. Commented Aug 13, 2022 at 9:31