# Mboxcox, interpreting difficult regressions

Mboxcox in Stata suggests transforming my variables using a power of 0.1 for the independent variable, and 0.4 for the dependent variable.

I have run the model, and it fixes problems associated with the assumptions of OLS. But certainly, it complicates matters in terms of interpretations.

Please outline possible interpretations and solutions.

Dependent variable is in millions of dollars, and independent variables are number of years. and a number of dummies which do not require transformation.

• If you carefully read the article on which this code is based, you will find this key bit of advice: "Following the advice of Sheather (2009), we round the suggested powers to the closest interpretable fractions" (emphasis added). For many people, those would be the "fractions" $0$ (in place of $0.1$) and $1/2$ (or possibly $1/3$, in place of $0.4$). Some might even round $0.4$ to $0$ or $1$. You need to select the rounding based on the possible interpretations and what any underlying theory suggests.
– whuber
May 30, 2013 at 15:49
• @glen_b One excellent reason to transform the independent variable is explained and illustrated (with an example) here.
– whuber
May 30, 2013 at 15:51
• @whuber Thanks; indeed I am aware of that as a reason to do so (and do so transform sometimes, for that reason). I wondered why the OP in particular was doing it (hoping it was something like that, but considering the possibility that they might instead have thought IVs need to have a normal distribution). May 30, 2013 at 16:05
• A Box-Cox parameter of zero corresponds to the logarithm, not the zero power. It sounds like you would benefit from reading some more background about this technique before proceeding further.
– whuber
May 30, 2013 at 19:45
• @landroni Since we condition on the IVs in ordinary regression, there's no distributional assumption whatever on them. Indeed, there's not even any unconditional distributional assumption on the DV itself (i.e. looking at a histogram or QQ plot etc of the DV is no use, since we make no particular assumption about that). If one is doing the usual normal-theory inference (hypothesis tests, CIs, PIs), there's an assumption about the distribution of the error term, which is assessed by residual diagnostics. This is discussed in comments or answers on dozens of questions here by various people. Mar 6, 2014 at 21:24

In my experience, likelihood methods for finding Box-Cox transformations of data are both poor (in performance) and unstable. They are contrary to the spirit and intended use of transformations, too, which include:

• Finding interpretable re-expressions of data,

• Attempting to linearize relationships,

• Attempting to achieve homoscedastic relationships,

• Allowing interactive exploration of data analysis options,

• Using calculations that are resistant to outlying values, and

• Being robust to alternative (but plausible) assumptions about data behavior.

Instead, by its very nature, a likelihood-based method (such as mboxcox, which aims to achieve [approximate] multinormality), violates all these aims, as you can check, one-by-one.

Nevertheless, almost since the time Box-Cox transformations were first described, people have been coming up with automated ways to estimate them. Few work well, but many sometimes give an approximate starting point, or range of starting points, to streamline the exploration.

Before we go on, let's establish the correct use of mboxcox. A careful reading of the article on which this code is based find this important suggestion: "Following the advice of Sheather (2009), we round the suggested powers to the closest interpretable fractions" (emphasis added). Traditionally, an "interpretable fraction" [sic] is a value that might appear in a physical theory: $$1/2$$, $$1/3$$ (and their negatives) along with whole values $$0, 1, 2$$ (and their negatives). Thus it was never intended that the user accept the output of mboxcox as-is: it has to be rounded according to knowledge of the data and the objectives of the analysis.

As a quick test of mboxcox, I applied it to the classical Mercury vapor pressure dataset popularized by John Tukey. It is the simplest multivariate dataset possible, containing $$19$$ (temperature, pressure) pairs with extremely small errors, leading to little uncertainty in what the best Box-Cox parameters ought to be. An exploratory data analysis (EDA) of this dataset is described in my answer at Box-Cox like transformation for independent variables?. It finds, correctly, that (after converting temperature to absolute temperature) the Box-Cox powers should be $$0$$ for the pressure and $$-1$$ for the temperature. (In this case, unlike in most data analyses, there is a correct answer given by a well-known physical law. That is why it makes a fine proving ground for any automated procedure.)

By contrast, when we apply mboxcox, at first it complains that it cannot deal with the zero temperature. If we simply exclude it--it will later found to be an outlier, anyway--it reports that the Box-Cox parameter for pressure should be $$0.3420578$$ (comfortably close to the convenient $$1/3$$, with a $$95$$% CI from $$0.22$$ to $$0.46$$) and for temperature should be $$2.2386$$ (CI from $$1.5$$ to $$3.0$$), which could be taken as close to $$2$$. Good, right? Both are highly significant. But, as we know--and can see in the nonlinear trend in the scatterplot--these are awful results, because we really need to be using the absolute temperature. Let's start over after adding $$273$$ degrees to the temperatures. Because there will no longer be a problem with zero, we will include all the data. This time mboxcox reports that the Box-Cox parameters should be $$0.0712114$$ for pressure and $$0.2411739$$ for temperature (CI from $$-0.8$$ to $$1.3$$). Even after rounding both values and accounting for the long confidence interval for temperature, the results are far from correct--even though the $$R^2$$ value in the resulting regression of (transformed) pressure on (transformed) temperature actually exceeds what is achieved when the correct parameters are used! Although this is a beautifully linear relationship on this scale, examination of the residuals shows it leaves much to be desired. NB: The y-axes on these plots are not directly comparable, because they represent different re-expressions of the pressures. What is of concern are the apparent patterns of non-linear behavior and serial correlation in each plot. The right plot does a better job at identifying the outlier (at a temperature of 0) and is much more horizontal than the left plot (mboxcox), which shows a clear curvilinear trend and is nowhere horizontal.

If we remove the case with the lowest temperature (which is the main source of the difficulty, even though it's not much of an outlier), mboxcox finally gets it right: it estimates a parameter of $$0.013$$ for pressure, which clearly rounds to $$0$$, and $$-0.8559$$ for temperature (CI from $$-1.4$$ to $$-0.3$$), which anyone would round to $$-1$$, with a possible $$-1/2$$ contained in the confidence interval. But it took three tries and required an insight (the use of absolute temperatures) that dropped out of the original EDA but had to be supplied by the analyst using mboxcox.

With the results of this quick look we may deduce that mboxcox indeed has the potential to deliver useful starting points for an EDA of multivariate data, provided it is carefully protected by first identifying outliers, that the estimates are appropriately rounded, and that the data are further explored to make sure that other Box-Cox parameters (even those far from the "optimal" ones) might not serve better. I would give little weight or credence to the mboxcox results without extensive follow-on analysis, because although it aims at establishing an approximate multivariate normal distribution of the data, that does little to assure either linearity or homoscedasticity and likely places too much emphasis on transforming the independent variables instead of the dependent variable itself.

• Excellent answer. I'd underline that identifying a good functional form for the relationship between variables is widely underestimated in importance, while being right about the distribution of errors is widely overestimated. May 30, 2013 at 17:15
• Thanks @Nick. I'm actually expecting comments and debate about what makes the result of an EDA "correct." The example here is interesting in that if we had no prior theory to guide us, it would be much tougher to decide whether to reject the second mboxcox result: it hinges on a somewhat delicate assessment of the residuals. In practice, especially with sociodemographic and biological data, different analysts using different procedures can legitimately arrive at equally valid but strikingly different ways of expressing the variables, leading to different functional forms.
– whuber
May 30, 2013 at 17:27
• You question indicates the contrary: since mboxcox returned different values of the parameter for the DV and IV, it sounds like you do have an issue with linearity; and because the value it returned for the DV differs substantially from $1$, you do have an issue with homoscedasticity! Moreover, it would be rare to have any reason to want regression data to be normal; this is neither expected nor assumed of standard regression techniques. The presence of a zero in your data also indicates you will have problems with mboxcox, as my own experience attests.
– whuber
May 30, 2013 at 19:37
• @landroni The distinction being made is between the data (the response values) and their residuals. Some regression techniques make parametric assumptions about the distributions of the residuals. It is rare that additional assumptions are made about the response itself: its distribution is determined by the explanatory variables and the distributions of the residuals.
– whuber
Mar 6, 2014 at 23:11
• @landroni Not for fixed-effects models: they do not assume the IVs are random variables at all.
– whuber
Mar 7, 2014 at 13:54

Although you have given some details, this is too close to "I have some data, want to fit a regression, and can't interpret my model easily" to allow much to be said easily that is likely to be really helpful. Too much depends on what your field is, what models make sense or are interesting substantively in that field, etc., not to mention finer details of your data. Not least, what is "interpretation"? It can mean anything from "I don't understand the statistics here, so need technical explanation on my level" to "What does this imply in subject-matter terms?".

But (personal opinions mixed in here)

• If your response or dependent variable is a count, I would expect Poisson regression to make much more sense than regression. Even if it is a measured number of years that is zero upwards, I would still expect that. http://blog.stata.com/tag/poisson-regression/ is one account rich in Stata context.

• The idea of Box-Cox is letting your data indicate which transformations make most sense. However, Box-Cox like much else is a knife that you can cut yourself with. The original examples are instructive: Box and Cox didn't use the precise powers indicated, but logarithm and reciprocal, which made sense on other grounds. Unless you are fitting a power law, it is usually more practical to regard Box-Cox as pointing to one of a small number of standard transformations, most commonly log, root or reciprocal. It is rare that (say) powers such as 0.4 can be related to substantive literature unless there is good theory underpinning the use of fractional powers in the first place. The fact that most common transformations can be regarded as members of a family doesn't mean that all members of that family are equally helpful.

• I do not have a count in the independent variable. As I said, its millions of pounds, and therefore I would not use poisson regression. Counts are in the dependent variables, and previously I was told that when that happens there is no case to use poisson regression. May 30, 2013 at 19:22
• Sorry, my ambiguity, which I have fixed in an edit. I was referring to your response (dependent variable). (I did say "number of years".) Contrary to your assertion, counts as response are the canonical case for Poisson regression. May 30, 2013 at 19:29
• There's confusion here, Nick, but it's not your fault: the question still states the DV is "number of years," which is manifestly not a count, it's a duration.
– whuber
May 30, 2013 at 19:44
• @IdiotAbroad You are telling us currently that your dependent variable is a count. But on checking your post again, I see that you refer to several dependent variables. Are you confusing dependent (conventionally $y$) and independent variables (conventionally $x$)? May 30, 2013 at 19:49
• Sorry - I do apologise. I cannot concentrate right now. My regression is investment = age + d1 + d2 + d3 etc May 30, 2013 at 19:58