I found an outlier using the outlierTest function in the car package. However, I can see from the results that the Externally Studentized Residual and p-values. This is a result for the full model.
rstudent unadjusted p-value Bonferroni p
348 5.872682 7.9377e-09 3.9689e-06
Cooks D Bar Plot:
I have performed normality test on residuals using the following code:
shapiro.test(resid(housing.lm))
R Console:
Shapiro-Wilk normality test
data: resid(housing.lm)
W = 0.97068, p-value = 1.876e-08
The p-value is less than 0.05 indicating that the residuals may not be normally distributed. However, I assume it is not critical for linear regression as long as the other assumptions are met.
I have also performed heteroscedasticity test using the following code:
ncvTest(housing.lm)
R console:
Non-constant Variance Score Test
Variance formula: ~ fitted.values
Chisquare = 0.3243994, Df = 1, p = 0.56898
When I fit the regression using the coded:
lm(price~ bath + sqft, data=data)
My diagnostic plots looks as follows;
When try to remove observation 348 based on the p-value sqft variable becomes insignificant. Is it better to keep it since it seems an influential point?