3
$\begingroup$

Caveat: This question may be a tad rambly, and I welcome comments with specific directions for me to improve it.

During a too brief exchange with the worthy @NickCox I got to thinking about transformation/back transformation and inference.

It seems to me pretty apparent that frequentist inference—confidence intervals, hypothesis tests—about a transformed variable $f(x)$, is not inference about the untransformed variable $x$, even when back-transforming inferential quantities (via $f^{-1}(x)$), because, generally, $\sigma^{2}_{f(x)} \ne f(\sigma^{2}_{x})$, unless $f(x) = x$, and both CIs and hypothesis tests rely upon an estimate of the variance. To quote from my answer here:

Basing CIs on transformed variables + back-transformation produces intervals without the nominal coverage probabilities, so back-transformed confidence about an estimate based on $f(x)$ is not confidence on an estimate based on $x$.

Likewise, inferences about untransformed variables based on hypothesis tests on transformed variables means that any of the following can be true, for example, when making inferences about $x$ based on some grouping variable $y$:

  1. $x$ differs significantly across $y$, but $f(x)$ does not differ significantly across $y$.

  2. $x$ differs significantly across $y$, and $f(x)$ differs significantly across $y$.

  3. $x$ does not differ significantly across $y$, and $f(x)$ does not differ significantly across $y$.

  4. $x$ does not differ significantly across $y$, but $f(x)$ differs significantly across $y$.

It is also very easy to imagine examples setting this point down sharply. For example, if $y_{i} = x_{i}$ then Pearson's $r=1.0$ for $y$ and $x$, but Pearson 's $r=0.0$ for $y$ and $x^{2}$ if the distribution and range of $x$ is symmetric about 0.

On the other hand, tricks like Oehlert's Delta method can provide a 'back-transformation' that approximates the correct variance of $x$ as an alternative to simply calculating it directly, or calculating it as $f^{-1}\left(\sigma^{2}_{f(x)}\right)$.

Good Nick Cox however, points out that to "estimate on a link scale and report on the original scale is central to generalized linear models," and that (if I understood correctly) inference on the geometric mean entails such back-transformation in the form $exp\left(\frac{\sum \log (x)}{n}\right)$.

When is it Ok to base inferences about (untransformed) $\boldsymbol{x}$ on back-transformations of estimates and inferences on $\boldsymbol{f(x)}$, and when is it not?

Second caveat: I am not calling Nick Cox out to defend any position with this question, and am genuinely interested in understanding when performing inference on $\boldsymbol{f(x)}$ but drawing conclusions about $\boldsymbol{x}$ based on back-transformation makes sense and does not make sense.

$\endgroup$
  • $\begingroup$ I think there's an important question here but I worry about its current phrasing. It seems like a pretty broad question. Certainly there's things that people do when backtransforming that make no sense (such as you identify in your question), but there's so many things that someone might do that make no sense there's a danger people might start trying to post lists of things that one might naively screw up. It may be better if answerers try to focus on how to address questions relating to untransformed variables using an analysis of a transformed version of the variable . ... ctd $\endgroup$ – Glen_b -Reinstate Monica Oct 9 '19 at 21:44
  • $\begingroup$ ctd... and perhaps what kinds of questions might survive through a transformation fairly directly, as well as perhaps some alternatives (such as choosing a suitable parametric model for the scale the question is on). $\endgroup$ – Glen_b -Reinstate Monica Oct 9 '19 at 21:46
  • $\begingroup$ Not sure if I am hitting the things you want covered. If you have some specific questions, please feel free to ask them. $\endgroup$ – Glen_b -Reinstate Monica Oct 10 '19 at 0:34
  • $\begingroup$ Thank you @Glen_b I have made one tiny edit based on your first comment. The second one is interesting... although I did not specify monotonic transformations, and indeed gave an example of a function which was not, I suppose I risk creating a strawman (strawperson?! ;) argument if most applications of inference on $f(x)$ gets back-transformed to $x$ are indeed monotonic transformations as in your answer. $\endgroup$ – Alexis Oct 10 '19 at 16:25
  • 1
    $\begingroup$ I'd say in practice they're almost always monotonic (in the range of the data at least); otherwise backtransformation is going to be problematic: Consider a transformation like $y^* = (y-6)^2$. Then, for example $y=4$ and $y=6$ both end up at $y^*=4$. So if you fit a model to $y^*$ and have a predicted value $\hat{y}^*=4$, what's your predicted value for $y$? Is it $4$ or $6$? $\endgroup$ – Glen_b -Reinstate Monica Oct 10 '19 at 22:12
4
$\begingroup$

You actually lay out most of the important points in your question.

I assume we're restricting attention to strictly monotonic transformations.

Monotonic transformations preserve order so quantiles are "preserved" (more precisely, quantiles are equivariant to monotonic transformation) but they don't preserve relative lengths/distances so moments and moment ratios are not "preserved".

So for example, if $Y$ has mean $\mu_Y$, median $\delta_Y$ and standard deviation $\sigma_Y$, and $Z=t(Y)$ for some monotonic increasing transformation $t$ (with corresponding population parameters $\mu_Z$, median $\delta_Z$ and $\sigma_Z$), then backtransforming we have that in general $\mu_Y\neq t^{-1}(\mu_Z)$, $\sigma_Y\neq t^{-1}(\sigma_Z)$ but it is the case that $\delta_Y= t^{-1}(\delta_Z)$.

Similarly, modes are not preserved.

It's important to note that because relative distances are not preserved distances between quantiles are not equivariant. The backtransformed interquartile range is not the interquartile range of the original data, even though that works for the quantiles individually.

In many cases, the key is to be precise about what it is you want to know on the scale of the original response variable.

In hypothesis testing, if your null + assumptions corresponds to having the distributions are same, then on the transformed scale the distributions should still be the same. However, the relationship under the alternative is different. An example would be transforming, doing a two-sample t-test and transforming back. If the usual assumptions are satisfied on the transformed scale, then you're dealing with a location-shift alternative (though this is not absolutely necessary, somewhat more general alternatives can be dealt with). When you backtransform the alternative will not be a location shift. (For an example, if your transformation was the log, once you transform back you're looking at a change of scale, not location.)

A typical case where transformation crops up is when someone transforms a response in order to fit a linear regression model, producing an estimate of the conditional mean response. However, when you transform back you don't end up with the conditional mean.

You can find an approximation (e.g. via the delta method) to try to get a reasonable estimate of $E(Y|x)$ from estimates of $E(Z|x)$ and $\text{Var}(Z|x)$ where $x$ represents the vector of predictors. Alternatively if you're prepared to assume you have a normal distribution on the transformed scale you may be able to get more precise estimate of the conditional mean after backtransforming.

One common error with regression I've seen is people backtransform a coefficient estimate and treat the result like they would a coefficient in a regression. This usually doesn't make sense. It certainly doesn't describe a linear relationship between $Y$ and some predictor $x$. Interpretation of backtransformed relationships is nontrivial. Even additivity is not preserved. That is, if you had a main-effects model on the transformed scale you can't write a backtransformed conditional mean as a sum of nonlinear effects in the variables.

A simple example would be taking a log transform and transforming back by exponentiation. If you fit $\log Y = \beta_0 + \beta_1 x_1 +\beta_2 x_2+\epsilon$ then you cannot write $E(Y|x_1,x_2) = f(x_1) + g(x_2)$; you can't even assume symmetry on the log scale and have it hold for the backtransformed median (the connection would be multiplicative in that case). It's important to think about how the backtransformation acts on the whole relationship.

If conditional means are an important consideration, an alternative is generalized linear models. By writing the linear predictor as a model for the transformed mean (via the link function) rather than transforming the data, you end up with a model for the conditional mean on the original scale, and no similar issues result from backtransforming there (well, aside from the kind of error described in the previous two paragraphs).

There are times when transformation makes sense -- but most often this is when the transformed variable is easily interpretable in its own right.

$\endgroup$
  • $\begingroup$ "This usually doesn't make sense. It certainly doesn't describe a linear relationship between $Y$ and some predictor $x$." This is a nuance which I think gets overlooked sometimes. Back when we all had some fun playing with data together (I wish we did that more here! :) I tried to draw attention to exactly this point in my comment to rvl's answer. $\endgroup$ – Alexis Oct 10 '19 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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