Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Log Transformation of Variable


From   Eric Booth <ebooth@ppri.tamu.edu>
To   "<statalist@hsphsun2.harvard.edu>" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Log Transformation of Variable
Date   Sat, 26 Feb 2011 17:59:20 +0000

<>

You can use the log10() function, but (log+e) is not a recognized Stata function.  See help math_functions.
  e.g., 

 g transformed_dv = -log(dv)-log10(dv) 
*or*
g transformed_dv  =  -(log(p)+log10(p)) 


- Eric
__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
ebooth@ppri.tamu.edu
Office: +979.845.6754

On Feb 26, 2011, at 11:04 AM, Melissa King wrote:

> Good Morning,
> 
> I have a dataset that I would like to transform by multiplying the
> dependent variables by -log - e, or in other words, the negative
> logarithm minus its base. Despite searching this forum and the
> Internet, I have been unable to find any information on how to "tell"
> Stata to do this. I am able to transform my variable by multiplying it
> by negative log:
> 
> generate transformed_dep_variable = -log(dep_variable)
> 
> However, Stata errors out when I try to communicate -(log+e), because
> it no longer recognizes log as a function when I type this in:
> 
> generate transformed_dep_variable = -(log+e)(dep_variable)
> 
> Do any long-time Stata users have any suggestions?
> 
> Thank you in advance for your help!
> 
> All best,
> 
> Melissa King
> 
> *
> *   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/



*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index