Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 73253

Finding values that are two standard deviations above the mean

$
0
0
I need to find values of a variable that are two standard devotions above the mean. I want to create a signal for this variable when it crosses this threshold.

I have been doing something like below but this doesn't work at all.

egen memp= mean(emp)
egen stdemp= std(emp)
gen tstd=2*stdemp+memp
gen sig=0
replace sig=1 if tsdt>mean


and using this, I never have a signal. I thing I am mising something in here.
































Viewing all articles
Browse latest Browse all 73253

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>