Empirical Test for the Assumptions of Simple Linear Regression Linear Regression has the below set of Assumptions,


*

*The Y-Values (or the errors, "e") are independent!

*The Y-Values can be expressed as a linear function of the X variable.

*Variation of observations around the regression line (the residual SE) is constant (homoscedasticity).

*For given value of X, Y values (or the error) are Normally distributed.


Is there any empirical test instead of visual test in R that can be used to validate the Assumptions in 1, 2 and 4?
I can only find for Assumption 3,
Empirical Test: ncvTest() from CAR package
Value to be observed: p-value
Pass criteria: > 0.05
This is to make an automated script that can assist to choose the best model for a set non linear data using linear regression.
Do assist to point to any books or website if this has been discussed previously as my search has been futile. I find many approaches are visual based then empirical.
 A: There is a lot of merit in @Glen_b comment, you should not over rely on tests. They usually come with assumptions, and can lead you into situations where the usual p-values are no longer valid. Regression analysis is much more than simply testing some assumptions, and even if you fail to reject the nulls it's doesn't automatically imply that you are doing something profoundly meaningful. That said, here goes my answer.


*

*You will have some indication directly based on how you obtained the sample. The assumption is guaranteed to be true if you used random sampling. Otherwise you likely have some form of serial dependence, there is no general catch all test, and so the simply option is to use robust standard errors if you care about inference. 

*There is really no test for this. You could look at some plots between X and Y and determine if you think it looks reasonable. But this only feasible when you have only a few variables. If you are worried about this, you could look into kernel regression or spline fitting. Actually, as it turns out, you still estimate (consistently) the best linear approximation if the assumption is false.

*You might to consider White's general test. But again you could just opt for robust errors if you care about inference.

*You don't really need this assumption. Normality only holds value if your model delivers on the full set of assumptions (aka. The Gauss Markov assumptions). And even then, the only value added is exact inference in small samples. Here it is worth considering the nature of the Y variable. If you are modelling income, for example, you know the assumption is false because income is never negative. 
A: You can test independence of errors with the function durbinWatsonTest() from CAR package, aditionally take a look of packages gvlma and lmtest, first gives you a function for global validation of linear models assumptions, second provides a rich variety of diagnostic test for avoid pitfalls in the applying of linear models. Cheers.
