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
how to simplify the syntax? Code: keep if pvalueInter<.1 & pvalueMed1<.1 & pvalueMed2<.1 & pvalueMed3<.…
Same id but do not get matched (merge)Dear all, I have a problem that I do not understand why it is occuring. I want to merge two data fil…
Coding questionI am running into a wall on applying a predicted class of a state (all 50 states have one of four pr…
Missing values when generating lagged variable in panel dataContext: I'm using Stata 16.1 on Window 10. I have unbalanced panel data with 52 variables and 953 o…
Installing gtools package on a remote computer (with no admin access)Hello, I am working on a Remote Stata Server (OS: Windows Server 2016 Standard) with Stata/SE 15.1. …
Subscribe to:
Post Comments (Atom)
0 Response to log transformation of a ratio variable with small values
Post a Comment