# Linear regression: Evaluate probability of $Y>y| X=x$

Given a linear regression model with all the assumptions checked and validated, I would like to obtain the probability that $Y>y|X=x$. For example for the iris dataset, I would do the following to obtain the probability of $Y>5|X=1,2,3...7$:

plot(Sepal.Length~Petal.Length, data=iris)
lm1<-lm(Sepal.Length~Petal.Length, data=iris)
summary(lm1)
abline(lm1)
predict(lm1, newdata=data.frame(Petal.Length=1:7))
(summary(lm1))$sigma pnorm(5, mean = predict(lm1, newdata=data.frame(Petal.Length=1:7)), sd = (summary(lm1))$sigma, lower.tail = F)


Is such an approach correct assuming constant variance?

plot(lm1$residuals ~ iris$Petal.Length)
qqnorm(lm1$residuals)  • Thanks. Yes I am aware about the underlying assumptions. My question is, if the regression assumptions are valid, is this a correct methodology? – ECII Mar 15, 2014 at 10:38 • Yes: if the model is$y_i= x_i \beta+ \varepsilon_i$with the$\varepsilon_i\$ normally distributed with mean zero and a constant variance, then what you have done looks reaonable, though of course the numbers are overprecise. plot(Sepal.Length~Petal.Length, data=iris); abline(h=5) gives you a view of the information you actually have. Mar 15, 2014 at 10:46