BookmarkSubscribeRSS Feed
yiferic
Calcite | Level 5
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?
3 REPLIES 3
SPR
Quartz | Level 8 SPR
Quartz | Level 8
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
yiferic
Calcite | Level 5
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?
SPR
Quartz | Level 8 SPR
Quartz | Level 8
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

Discussion stats
  • 3 replies
  • 2255 views
  • 0 likes
  • 2 in conversation