Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Nick Cox <njcoxstata@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Log Transformation of Variable |
Date | Mon, 28 Feb 2011 09:21:57 +0000 |
I'm pleased that you now have apparently got what you wanted. But note that -ln(variable) is not correctly described in words as multiplying by the negative of the logarithm. There is no multiplication involved here. That quantity is the negative logarithm of the variable. I am curious also that the extra constant exp(1) ~ 2.71828 is wanted here. For example, it makes no different to the linearity of any relationship or the skewness or kurtosis of any distribution. Nick On Sun, Feb 27, 2011 at 7:25 PM, Melissa King <melissakng@gmail.com> wrote: > Thank you for your responses to my post. As Fernando, Nick and Gordon > pointed out, I did not want to multiply my function by (-log-e), which > was a typo. I wanted to multiply each data point by the negative of > log, and THEN subtract out the base of the log. I eventually figured > out how to generate the transformed variable using the following: > > generate transformed_variable = -ln(variable) - exp(1) > > Sorry to have submitted such a confusing post. This is what happens > when you work too many 16-hour days in a row. Next time I will sleep > on it before wasting anyone's time. Rich, this question actually had > nothing to to with my own work; it had to do with some unusual data my > husband Marty was working with. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/