1
$\begingroup$

I have data for different groups that includes positive, negative, and zero values. Here is an example:

group1: c(-503583,-395833,0.1,3835,19,-0.001,0,48400883)

group2: c(-39,-8340,-10,0,0.1,2889,93,10)

I am currently using the following log transform:

group1: log(1+Y1-min(Y1)) where Y1 is the group 1 data and min(Y1) is the group1 minimum (-503583)

group2: log(1+Y2-min(Y2)) where Y2 is the group 2 data and min(Y2) is the group2 minimum (-8340)

Here is my question: By using the min value for each group am I transforming them to different scales such that they are no longer comparable?

Do I need to transform them both using the global minimum (-503583) to allow the transformed data to be compared between group1 and group2?

I would like to create boxplots of my data showing the differences between the elevation and season groups. I have include three figures below of my data and the differences between the transformation options I have outlined.

This image shows the data without any transformation no transformation

This image shows the data when I apply the transformation "by group" meaning I subtract the minimum from each group when applying the transform. transformation by group

This image shows the data when I subtract the global min. transformation global min

EDIT: I have applied the inverse hyperbolic sine transformation as suggested by @Dimitriy V. Masterov and @Nick Cox. The resulting image is shown below:

This image shows the data with the IHS transform no transformation

My main goal with applying any transformation at all is to show how the data are different between the groups. It is very difficult to see the differences in the first image of the un-transformed data. What the data show are trends in volumetric flow in rivers. Positive values indicate an increasing trend and magnitude in volume (i.e. increase of 5E6 cubic-meters over 10 years) and negative values indicate a decreasing trend and magnitude of volume. Since all the values, including the zero, are genuine, the transformation that respects the sign is much more valuable for interpretation.

$\endgroup$
7
  • 1
    $\begingroup$ You might also add what you hope to accomplish with this transformation, since the answer depends on that to some degree. Take a look at the inverse hyperbolic sine transformation as an alternative. $\endgroup$
    – dimitriy
    Jun 19, 2018 at 20:30
  • $\begingroup$ The short answer to "By using the min value for each group am I transforming them to different scales such that they are no longer comparable?" is simply Yes. A slightly longer answer is that so long as you remember the minima then you can compare the results, but why use a different transformation in the first place? There is no rationale mentioned for that in the question. $\endgroup$
    – Nick Cox
    Jun 19, 2018 at 21:20
  • $\begingroup$ Halfway through the question we get mentions of elevation and season -- as if we knew about your project and your data. Really, we don't! Why not back up: tell us about your aim? What is the response variable? Evidently you have 4 elevation groups for sites and four for seasons. $\endgroup$
    – Nick Cox
    Jun 19, 2018 at 21:23
  • $\begingroup$ Generally when values can be negative, zero or positive, and the zero value is a genuine zero, transformations that do respect those signs are much preferable to those that don't. As @DimitriyV.Masterov mentioned, inverse hyperbolic sine is one. Neglog (sign(x) log(1 + |x|) is another. Cube root is another. $\endgroup$
    – Nick Cox
    Jun 19, 2018 at 21:26
  • $\begingroup$ I have worked on rivers among other things. When you say volume do you mean discharge? I'd be pretty clear that I would want to work with log discharge, not discharge, particularly for rivers of different sizes. If you work with a transformed scale, the axis labels are better in the original units $\endgroup$
    – Nick Cox
    Jun 20, 2018 at 9:30

0

Your Answer

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