# Uncertainty of a 'forced' slope for a linear regression

Let $$\mathbf{Y} = (Y_1,...,Y_n)$$ and $$\mathbf{X} = (X_1,...,X_n)$$ be two vectors of observations from variables $$Y$$ and $$X$$ respectively.

First, a linear regression model is used to find a relationship between the variables $$Y$$ and $$X$$. Thanks to $$\mathbf{Y}$$ and $$\mathbf{X}$$ we obtain a slope $$\hat{m}$$ and an intercept value $$\hat{b}$$ such that $$(\hat{m},\hat{b})$$ is given by the LSE and is an estimator of $$(m,b)$$ in the following equation: $$Y = mX + b \ \ \ \ \ \ \ (1).$$ In a second step, if $$\hat{b}$$ is lower than a certain value $$b^*$$, then we will suppose that the intercept term $$b$$ is null and that the estimated values $$\hat{Y}$$ of $$Y$$ are simply: $$$$\hat{Y} = \hat{m}X \ \ \ \ \ \ \ (2).$$$$

The goal is to find the (relative) standard deviation of the $$\hat{Y}$$ of equation (2) knowing that we used the slope given by the LSE of equation (1). Does anyone has an idea how to process?

• Your description is fine but the calculation of the coefficients does not incorporate your data generation or model selection process. First, the values $X$ are assumed to be fixed and known and not from a random variable. Second, it's not clear if you want to find an estimate of the standard error of the resulting slope conditioning on the fact that you've declared the intercept to be zero or if it's the standard error of the resulting slope irrespective of whether the intercept is declared zero or not. You might want to ask this at CrossValidated (stats.stackexchange.com).
– JimB
Mar 10, 2023 at 15:09
• Thanks JimB for your answer and clarifications. Indeed, X is not a random variable, I made a mistake. I add some explanations in the question. The final goal is to find the (relative) standard deviation of the $\hat{Y}$ of equation (2) knowing that we used the slope given by the LSE of equation (1). Mar 10, 2023 at 15:20

1. You theoretical model is $$Y = b + mX + \epsilon$$, where $$var(\epsilon|X) = \sigma^2$$. The OLS for this model is $$\hat m = \frac{\sum (Y_i - \bar{Y}) (X_i - \bar{X})}{\sum ( X_i - \bar{X}) ^ 2} = \frac{\sum (X_i - \bar{X})Y_i}{\sum ( X_i - \bar{X}) ^ 2},$$ thus $$var( \hat m |X) = \frac{\sum (X_i - \bar{X}) ^ 2 var(Y_i|X)}{(\sum (X_i - \bar X)^ 2)^2} = \frac{\sigma^2}{\sum ( X_i - \bar X) ^ 2}.$$
2. Hence, $$var(\hat Y|X) = var(X \hat m ) = \frac{X^2\sigma ^ 2}{\sum (X_i - \bar X)^ 2}$$.
• Thanks V.Vancak for your answer, maybe it is not very clear in the question but $\hat{m}$ is the LSE (or OLS) of the equation (1): $Y = mX + b + \epsilon$.Then the way you calculated the variance is probably wrong, isn't it? Mar 13, 2023 at 7:30
• Thanks for the correction and for your great help! Yes, of course, this should not be the case but I have to deal with these kind of modelling and quantify the uncertainty on $Y$. I also do not understand why it is done in this way. Mar 13, 2023 at 10:18