Hello and good day,
I have a panel data from 1996-2017 , I want to estimate the effect of uncertainty(WUI) on saving and in one estimation related to the robustness check , I want to " extreme observation" as those who are more than two standard deviations away from the mean.
I did in this way, But I think it is not correct :
gen WUI_exc=1 if WUI < (r(mean) - 2 * r(sd) ) | WUI> (r(mean) + 2 * r(sd))
replace WUI_exc=0 if WUI=.
I am so thankful to receive your assistance.
Best regards,
I have a panel data from 1996-2017 , I want to estimate the effect of uncertainty(WUI) on saving and in one estimation related to the robustness check , I want to " extreme observation" as those who are more than two standard deviations away from the mean.
Code:
Variable | Obs Mean Std. dev. Min Max -------------+--------------------------------------------------------- saving | 2,416 22.45331 10.1172 -19.90297 66.88411 WUI | 2,772 .1709153 .1834069 0 1.821079
gen WUI_exc=1 if WUI < (r(mean) - 2 * r(sd) ) | WUI> (r(mean) + 2 * r(sd))
replace WUI_exc=0 if WUI=.
I am so thankful to receive your assistance.
Best regards,
Comment