Log transform of data with negative values

Reply
Occasional Contributor
Posts: 8

Log transform of data with negative values

Hey all, I have some data that we're trying to analyze using mixed models but it looks like the data is non-linear. We decided to try a log transform since it looks like the fixed effect has an acute phase and then levels off after the first couple of weeks. The problem is the data has negative values (directionality is important). We're hearing conflicting suggestions about what to do next. Someone told us that we should add a constant to all the values and use the offset to make everything in the positive domain, while others said that's a bad idea. Any suggestions?
Super Contributor
Super Contributor
Posts: 365

Re: Log transform of data with negative values

Hello Yiferic,

I do not think that adding a constant to y is a bad idea. For a simple model
log(y+C)=A+SUM(BiXi), we get y=exp(A+SUM(BiXi))-C. What "others" say, why is it a bad idea?

Sincerely,
SPR
Occasional Contributor
Posts: 8

Re: Log transform of data with negative values

Thanks for the reply SPR, one of the issues is we don't know what constant to use and how it'll affect our likelihood/significance values. I'm assuming we should use a constant that's about the same order as the smallest negative value?
Super Contributor
Super Contributor
Posts: 365

Re: Log transform of data with negative values

Yes, it is true. This constant could be found from the equation log(y+C) = 1 for y < 0. This guarantees that log(y+C) => 0.

SPR
Ask a Question
Discussion stats
  • 3 replies
  • 691 views
  • 0 likes
  • 2 in conversation