4
$\begingroup$

I'm dealing with linear regression with a continuous outcome. Due to suspected non-linearity in one of the covariates (via scatterplot) I tried some possible transformations of the independent variable. Using the AIC as criterion, I have two models that seem suitable:

Model 1: $$ Y =\beta_0 + \beta_1 X + \beta_2 X^2 $$

Model 2: $$ Y =\beta_0 + \beta_1 X + \beta_2 \log X $$

I stumbled on model 2 more by accident, since I was trying to do a log-transformation but I forgot to exclude the main effect.

Both models give me a better model fit (based on AIC), but the fit with model 2 is even better than that of model 1 (the difference in AIC is quite big). I also tried a log-transformation of $X$ without the untransformed $X$-Term, but that gave me no improvement compared with the original model without transformation.

Is it ok to have $\log X$ as well as $X$ in the model? I don't see a reason why it would be a problem, but I've never encountered this situation before. Hence, I'm not quite sure. Additionally, I'm also not sure how to interpret such a model in terms of the effect of $X$.

Edit: Here the scatterplot with fitted curves superimposed. Model 3 refers to the model with $log(X)$ only.

enter image description here

$\endgroup$
11
  • $\begingroup$ Could you post a plot of predicted vs observed values, with the mean regression line superimposed, for each model? $\endgroup$
    – D L Dahly
    Commented Nov 29, 2013 at 11:09
  • 1
    $\begingroup$ Combining x and log x as predictors has been standard for some time in various fields. One heading is "fractional polynomials". See for example stata.com/manuals13/rfp.pdf and the references it cites. $\endgroup$
    – Nick Cox
    Commented Nov 29, 2013 at 11:16
  • $\begingroup$ Note, however, that neither model mentioned here features a transformation of the dependent variable. So, either you have a typo, or you are alluding to yet other models you tried. $\endgroup$
    – Nick Cox
    Commented Nov 29, 2013 at 11:17
  • 1
    $\begingroup$ The scatter plot of $Y$ vs $X$ with fitted curves superimposed would be even easier to think about than a plot of observed and predicted. $\endgroup$
    – Nick Cox
    Commented Nov 29, 2013 at 11:20
  • $\begingroup$ @Nick: Yes, there was a typo. I corrected it. $\endgroup$
    – Francis
    Commented Nov 29, 2013 at 12:32

1 Answer 1

1
$\begingroup$

It's fine to have both in the model and quite common for non-linear relationships. Essentially, when you take logs you're looking at the proportional change in the variable rather than the level. In your model 2 the $\beta_2$ coefficient tells you the levels change in $Y$ for a proportional change in $X$. For example, $\beta_2 = 2$ means that a 1% change in $X$ increases the level of $Y$ by 2.

$\endgroup$
2
  • 3
    $\begingroup$ Clearly $X$ and $\log X$ are dependent, so the interpretation of the coefficient of either has to be more nuanced than this when both are included in the model. But it's easy enough to differentiate the right-hand side in this case. $\endgroup$
    – Nick Cox
    Commented Nov 29, 2013 at 15:53
  • $\begingroup$ Yes, thanks for the clarification, that was careless of me. $\endgroup$
    – jmz
    Commented Nov 29, 2013 at 20:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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