Hi,
I am using Stata 13. I got a technical question related to the transformaton of data related to a discussion on stackexchange (see link below). The problem evolves around the treatment of highly skewed positive data with zeroes. Merely ln-transforming a variable [var] results in missings for [var=0] . I decided to generate a dummy that takes on 1 if the non-transformed variable has a value of 0. The dummy has a value of 0 otherwise.
Here is a an example of what I do:
A historgram of tenure shows it is positively skewed. I geneate [ln_tenure] and the bespoke dummy [null_tenure]. However [null_tenure] gets omitted. How can I avoid the dummy being omitted?
Best
/R
I am using Stata 13. I got a technical question related to the transformaton of data related to a discussion on stackexchange (see link below). The problem evolves around the treatment of highly skewed positive data with zeroes. Merely ln-transforming a variable [var] results in missings for [var=0] . I decided to generate a dummy that takes on 1 if the non-transformed variable has a value of 0. The dummy has a value of 0 otherwise.
Here is a an example of what I do:
Code:
clear sysuse nlsw88 gen ln_tenure=ln(tenure) gen null_tenure = 0 replace null_tenure=1 if tenure==0 reg wage grade ln_tenure null_tenure
Best
/R
Comment