I have residuals for my model. They are simply measured-predicted. However, I notice that they do not follow a normal distribution. I want to make my residuals distribution normal so that I can obtain confidence intervals that are representative of the distribution. I have tried doing the following:
>library(MASS)
>boxcox(residuals)
Error: $ operator is invalid for atomic vectors
However, I get an error. After looking at the Box-Cox more closely I have to input a formula or fitted object. If I input the measured vs. predicted fit, will the Box-Cox transformation normalize the residuals? Is there another way to implement the Box-Cox transformation so that it only needs to look at the distribution of the data?
residuals
at a new command prompt will show you this refers to a function inR
. It would be wise not to use it to name anything else (unless you wish to override the default implementation). $\endgroup$boxcox
clearly says that what you need to pass toboxcox
is a model, either as a fitted model object or a formula. But before you do that, tell us about what your variables are (especially what is your response measuring?), and what the problems are in your model diagnostics (what makes you say it's non-normal? what does it look like?). $\endgroup$