My goal is to get the residual standard error of my model to be as small as possible. I have a linear model lm(y~x). When I plot the standardized residual errors in function of the explanatory variable I get the following plot:

enter image description here

so it seems like I need a quadratic term in my model lm(y~ x + x²) which then gives me the following standardized residual errors in function of x

enter image description here

Now the Breusch-Pagan test gives the following output on my model with a quadratic term

studentized Breusch-Pagan test

data: model_B2_squared BP = 7.5556, df = 2, p-value = 0.02287

meaning that there is still heteroscedasticity? Meaning that the residual standard error in my output summary is not correct?

"Residual standard error: 0.8906 on 75 degrees of freedom"

How can I get a good estimate of my residual standard error that is not completely wrong? I know we can get robust standard errors for my coefficients of my model, but what about the residual standard error? I really need a good estimate for it for my research.

One thing that jumps out at me is that the variance of the error increases with x. This suggests a multiplicative model. What happens if you fit lm(log(y)~x)?

I believe that it is because your predictor variable (x) is 1,2,3,4,5 or 6 and that is why your residuals look like that. I don't think there is any way to transform your predictor variable to make your residuals look better.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.