0
$\begingroup$

I've got a linear regression model with 7 explanatory variables that I've put through the boxcox function in r and got a 95% interval for $\lambda$ of approximately (.25, .5). I know this suggests a transformation of y$^{\frac{1}{4}}$ to y$^{\frac{1}{2}}$ so I should be plotting say $\sqrt y$ ~ 7 explanatory variable but how do I do that in r? Do I simply create another linear model y ~ ($x_1+x_2+x_3+x_4+x_5+x_6+x_7)^2$? Thanks in advance for any guidance.

$\endgroup$

1 Answer 1

1
$\begingroup$

In performing Box-Cox method in R, it is true to first plot the confidence interval (suppose the model name is lm.fit)

boxcox(lm.fit, plotfit=TRUE, lambda = seq(0.1, 0.1)

As you get $\lambda=0.5$, in coding you may write:

boxcoxfit <- lm(Response^(0.5) ~ 7 Predictors, data)

Then your fit will be the one after Box-Cox transformation. However, if you are to present your result, then you may write your model as:

$$Response^{\frac{1}{2}} = intercept + \beta_1x_1+......\beta_7x_7$$

Hope this simple guidance helps.

$\endgroup$

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