07-21-2015 04:29 PM
I'm working on some pilot data and naturally I have a non-normal distribution for my outcome. I tried to alleviate this by converting my outcome (continuous) variable to a log base 10 variable. Unfortunately, one of my outcome variables is 0 so SAS gives me the "NOTE: Invalid argument to function LOG10 at line nnn column nn" error message and then treats that variable as missing. Is there a way to solve this?
I made the new variable in a "set" statement so the ?? modifier doesn't seem to work.
Any advice would be much appreciated (I'm a freshie, go easy on me)!
07-21-2015 05:37 PM
Well, its true, you can't take the log of 0.
One simple way is to add 0.1 to the 0, if that's valid.
Depending on the data there may be other transformations or methods that are available.
if pilot=0 then pilot2=0.1;
07-21-2015 06:05 PM
Logarithmic transformation would make sense for your data if zero values actually mean that the value was too small to be measured. In that case, many analysts will replace zeros with half the smallest value that can be measured, before taking the logarithm.
Taking logarithms is only one of many ways to deal with non-normal data. We would need to know more about the nature of your data to suggest other methods.
07-21-2015 09:30 PM
Values that were too small to be measured were treated as missing data.
That amounts to left censoring. Wouldn't that automatically create an upward bias in your location (mean, median, etc.) estimates?
07-22-2015 02:01 AM
I can see how it could cause that...but I'm not sure what else to do. Because for those observations not enough biological sample was obtained for a proper measurement to be taken.
07-22-2015 11:23 AM
Here are a few articles that discuss the problem you mention and suggest a few potential work-arounds: