# Log transformed variable and main effect

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.

• Could you post a plot of predicted vs observed values, with the mean regression line superimposed, for each model? Commented Nov 29, 2013 at 11:09
• 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. Commented Nov 29, 2013 at 11:16
• 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. Commented Nov 29, 2013 at 11:17
• 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. Commented Nov 29, 2013 at 11:20
• @Nick: Yes, there was a typo. I corrected it. Commented Nov 29, 2013 at 12:32

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.
• 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. Commented Nov 29, 2013 at 15:53