I have some issues with my linear difference-in-difference analyses. My outcome is health care costs, where a lot of people have 0 costs and some have really high costs. Therefore, I logtransformed my costs. I tried log10 + 1 and ln + 1. Both resulted in the same beta's and confidence intervals. If I back transform my costs, do I have to extract 1 after the back transformation?

For example: after back transforming with 10^.. or exp, my beta is 1.513. Do I have to do - 1 so that my beta becomes 0.513?

If yes, and my beta becomoes 0.513, are my beta's just health care costs? So in the treatment group individuals have 51 cent higher costs over time?

If no, and my beta stays 1.513, does that mean it is a factor? So my costs increase 51%?

Thank you!

New contributor
Joella is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Joella, what proportion of study subjects have a zero health care cost? If the proportion is sizeable, you could consider a so-called two-stage model.

In the first stage, you can use a binary logistic regression, for example, to model the log odds (hence the probability) of having a non-zero cost (i.e., a positive health care cost) as a function of various relevant factors (e.g., treatment, age, gender). This first stage would use the data from all of your study subjects.

In the second stage, you can use either a linear model or a generalized linear model to model the expected value of health care costs among those who had a positive health care cost as a function of relevant factors. This second stage would use the data from just those study subjects with a positive health care cost.

See: https://www.herc.research.va.gov/include/page.asp?id=analyzing-cost-data

| cite | improve this answer | |

Let's assume you used the natural logarithm $ln(y)$ as transformation function.

Your regression model would look as follows

$ln(y) = \beta_0 + \beta_1x_1 + \dots + \beta_n x_n$.

To interpret the meaning of each coefficient $\beta_i$, you would have to exponentiate both sides such that

$e^{ln(y)} = y = e^{\beta_0 + \beta_1x_1 + \dots + \beta_n x_n} = e^{\beta_0} e^{\beta_1 x_1} \dots e^{\beta_n x_n} $.

So we can see, that the effect on our outcome $y$ is multiplicative.

For example, if the covariate $x_i$ increases by one unit, then your outcome gets multiplied by the factor $e^{\beta_i}$ because we can write $e^{\beta_i (x_i+1)} = e^{\beta_i x_i} e^{1 \beta_i} = e^{\beta_i x_i} e^{\beta_i}$.

In general, your change will be the new value of your outcome $y'$ (after the change) divided by the old value of your outcome $y$ (prior to the change of your covariate $x_i$). So you can denote it as follows

$\frac{y'}{y} = \frac{e^{\beta_0} * e^{\beta_1 x_1} * \dots * e^{\beta_i x_i} * e^{\beta_i} * \dots * e^{\beta_n x_n}}{e^{\beta_0} * e^{\beta_1 x_1} * \dots * e^{\beta_i x_i} * \dots * e^{\beta_n x_n}} = e^{\beta_i}$

Because it is a single factor, you can make the change interpretable by computing by how much percent your outcome variable increases/decreases, depending on whether $e^{\beta_i}$ is larger/smaller than one.

Now, let's assume you used $ln(y+1)$ as transformation. Then we get the following relationship after inverting the transformation

$e^{ln(y+1)} = y+1 = e^{\beta_0 + \beta_1x_1 + \dots + \beta_n x_n} = e^{\beta_0} e^{\beta_1 x_1} \dots e^{\beta_n x_n}$

and therefore,

$y = (e^{\beta_0 + \beta_1x_1 + \dots + \beta_n x_n}) - 1 = (e^{\beta_0} e^{\beta_1 x_1} \dots e^{\beta_n x_n}) - 1$.

So, if the covariate $x_i$ increases by one unit, then your outcome changes by the following multiplicative factor

$\frac{y'}{y} = \frac{(e^{\beta_0} * e^{\beta_1 x_1} * \dots * e^{\beta_i x_i} * e^{\beta_i} * \dots * e^{\beta_n x_n})-1}{(e^{\beta_0} * e^{\beta_1 x_1} * \dots * e^{\beta_i x_i} * \dots * e^{\beta_n x_n})-1}$

which cannot be easier expressed. Still, you can compute the percentage change as mentioned above, to get an idea of how the outcome changes in terms of percentages.

| cite | improve this answer | |
  • $\begingroup$ Thank you for your response SolingerMUC! I now understand that I've to extract the 1. However, I'm not quite sure about the interpretation. Do you mean that is my beta is 0.513, my costs decrease? I'm still confused about interpetation, is that a factor of just the costs? $\endgroup$ – Joella Jun 30 at 10:37
  • $\begingroup$ You don't subtract for the coefficients, just for predictions... the coefficients are approximately unaffected, depending on the range of y. $\endgroup$ – Michael M Jun 30 at 10:57
  • $\begingroup$ I'm sorry, Micheal I don't understand how. If I log transform my outcome, I have to back transform my beta after my analysis right? $\endgroup$ – Joella Jun 30 at 12:08
  • $\begingroup$ You can use $\beta$ to conclude an additive effect (difference) on your transformed outcome $ln(y+1)$, such that a one-unit increase in $x$ changes the value of $ln(y+1)$ by $\beta$. However, if you want to make the effect interpretation based on the original (untransformed) outcome $y$, then you have to compute the effect of the one-unit change in $x$ by first by applying some transformation (such as the one shown above) on $\beta$ to get the factor by which your outcome $y$ will change. $\endgroup$ – SolingerMUC Jun 30 at 12:14
  • $\begingroup$ Thank you Solinger! I see what you mean!! $\endgroup$ – Joella Jun 30 at 15:21

Your Answer

Joella is a new contributor. Be nice, and check out our Code of Conduct.

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.