0
$\begingroup$

Background:
I want to explores the effect of 3 different treatments on pain felt during a medical procedure. Pain has been assessed using visual analogue scales. Pain values can be anywhere from 0 to 100. 0 = no pain felt.

What I am trying to do
I am trying to run a regression model so I can control for other factors which may influence pain.

The Problem
My data has lots of zeros (meaning no pain was felt), so even after log transformation (I tried log(x+1) and log(x+0.1)), I still have skewed histograms for each of the treatment groups. The only time I am able to get an approximately normal distribution is when I have a higher constant... so I tried log(x+7), which gave me the approximate bell-shaped curve I was looking for in the histogram...

My question
Is it okay to do this statistically and in my case? I have not been able to find any websites that explain why the constant for a log transformation needs to be small, so I'd love to know if this is okay to use a larger constant than 1, and if not, why not?

$\endgroup$
6
  • $\begingroup$ Welcome to Cross Validated! To a large extent, doing a $\log(x+c)$ transformation of any kind means you’ve botched the modeling. Why do you want to do a $\log$ transform of any kind? $\endgroup$
    – Dave
    Commented Nov 25, 2022 at 16:20
  • $\begingroup$ @Dave Thank you! :) I've also tried non-parametric tests... but they don't allow for controlling for other variables that may influence pain. My data is really skewed because of the 0s and so far, I've been taught in my course that log transformations can help "normalize" the data, which is what I've tried. I'm very new to biostats and very confused about this - apologies... $\endgroup$
    – Rihat
    Commented Nov 25, 2022 at 16:26
  • 5
    $\begingroup$ If you have many 0's no transformation will solve that; all the values are equal no matter where you transform them to, and any monotonic transformation will leave them all at the low end of the range, so no matter what you do you will have a spike of probability at $t(0)$. Transformation is not a solution to this issue. It's possible that automatic choice of bin width and bin origin in your histogram has simply disguised this fact at some particular choices of $c$. $\endgroup$
    – Glen_b
    Commented Nov 25, 2022 at 16:29
  • $\begingroup$ @Glen_b thank you for explaining this to me! :) I really appreciate it $\endgroup$
    – Rihat
    Commented Nov 25, 2022 at 16:43
  • 2
    $\begingroup$ If you’d go for a nonparametric test like Wilcoxon but want to add covariates, a proportional odds model is an extension of the Wilcoxon test that allows for all of the usual covariate tricks that you get from linear regression. $\endgroup$
    – Dave
    Commented Nov 25, 2022 at 17:36

1 Answer 1

2
$\begingroup$

As the comments indicate, a $\log(x+c)$ transformation is probably not the best way to model your data. That said, if you want to use that type of transformation then there is no theoretical restriction on the choice of $c$. The difficulty is that the farther $c$ is from 0, the harder it is to interpret the coefficients of the predictors in the usual way, in terms of proportional effects on outcome.

It's also not clear that looking at histograms within treatment groups is the best way to evaluate the transformation. As you have multiple other predictors, what's ultimately of interest is the distribution of residuals between observations and model predictions.

@Dave's suggestion of a proportional-odds model can be a good way to handle ordered outcomes in a regression model without needing to transform outcome values. If you have a lot of 0 values, you might consider a type of hurdle model, which would combine a model of whether there was any pain with a model pain intensity when there was.

$\endgroup$

Your Answer

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

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