*-2.5.3.1 删除
sysuse auto, clear
adjacent price, by(foreign)
drop if (price>8814&foreign==0) |(price>9735&foreign==1)
*-or // 需要提前安装-egenmore-相关命令
sysuse auto, clear
egen outby = outside(price), by(foreign) factor(2)
drop if outby != .
*-2.5.3.2 对数转换
sysuse nlsw88, clear
gen ln_wage = ln(wage)
twoway (histogram wage,color(green)) ///
(histogram ln_wage,color(yellow))
sum wage ln_wage, d
graph box wage
graph box ln_wage
*-2.5.3.3 缩尾处理
sysuse nlsw88.dta, clear
histogram wage
*-双边缩尾
winsor wage, gen(wage_w2) p(0.025)
*-图示
twoway (histogram wage,color(green)) ///
(histogram wage_w2,color(yellow)), ///
legend(label(1 'wage') label(2 'wage_winsor2'))
*-单边缩尾