110031037 发表于 2019-5-23 16:39 https://www.statalist.org/forums/forum/general-stata-discussion/general/625369-log-transformation-of ...
"The main effect of the log-modulus transformation is to spread apart markers that are near the origin and to pull in markers that are relatively far from the origin. By using the transformation, you can visualize variables that span several orders of magnitudes in both the positive and negative directions. "
我个人觉得这个方法适用于直观图表或定性分析,不适用于后面还需要在对数化后的数据进一步计算的情况。作者给出的情况是数据中有很多负值,直接散点图观察,由于分布的离散程度不够不能观察到具体的正向和负向偏离的情况,采用这个方法后偏离情况在图上显示比较清楚了。
直接取对数在回归模型中,有清楚的经济含义,而这个方法的经济含义不明显。sign(x)可以返回0 -1 和1,log是以10为底的对数,不是stata中的log函数。
但是也不妨可以拿来试试gen var2=sign(var1)*log10(abs(var1)+1)