I log-transformed a ratio variable (sem), which ranged from 5.73e-10 to .0001021 (mean: 1.72e-06, s.d.: 2.15e-06).
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
sem | 9176 1.72e-06 2.15e-06 5.73e-10 .0001021
To prevent negative numbers after log transformation, I added 1 to the original variable like below.
gen lsem=log(sem+1)
But, the log transformation was failed as follows. All values remained unchanged.
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
sem | 9176 1.72e-06 2.15e-06 5.73e-10 .0001021
lsem | 9176 1.72e-06 2.15e-06 5.73e-10 .0001021
What was wrong? How can I log-transform this variable?
Related Posts with log transformation of a ratio variable with small values
Three-tier Multi-Level Model: violation of the assumptions of normality and heteroscedasticity Dear colleagues, I am working with educational data. To do so, I am using the classic three-level h…
Lasso for selection of variables and running logit regression using selected variables in lassoHi all, Can someone help me please, I am assessing the impact of income(X1) on economic growth (Y) b…
Page Up and Page Down don't work on LinuxThe documentation says: Page Upsteps backward through the command history. Page Downsteps forwar…
What is the relationship between decomposition of margins?I'm reading the documentation for margins, and in particular "Example 9: Decomposing margins". In t…
Geocoding in StataI have address variable (~700k observations) and I would like to get latitude and longitude of the a…
Subscribe to:
Post Comments (Atom)
0 Response to log transformation of a ratio variable with small values
Post a Comment