Solved – Regression and transforming variable with square root

data transformationrregression

I have a variable that can range from -100 to +100. When the number is -100, the output from this transformation should be something like 10. For +100 it should be around -10, and for 0 it should be 0. However, the points in between may be skewed so that the value for 1 is not necessarily .1, it may be 2 or .05.

What formula or transform should I use when putting this variable into a linear model for R? I feel like there's a sqrt or log involved but negative values are no good. There are many options, what's the best?

I'm looking for something like:
$$y = B_1(x_1) + B_2(x_2) + B_3(transform(x_3))\\$$

I'd like the B3 to be able to tell me the skewness of the variable.

Best Answer

There are any number of smooth transformations which go through those three points.

Here are three examples:

enter image description here

The most obvious, as Jeremy points out in comments, is a simple linear transformation (blue in my plot above).

The red one involves a square root function (but is more complicated), and the green one involves a quadratic (it's quadratic to the left and right, but they're different quadratics which join smoothly). There's an infinite number of other functions you might choose.

We can't tell you what's best for your purposes unless you define 'best' in very specific terms.

Can you explain what properties you need to have in between the specified points?