Hello,
I want to generate a dummy variable that gives a value of 1 if the value of a variable is between the range of the 5th and 95th percentile, 0 otherwise
I did the following:
But afterwards for all firm-year observations it is giving an 1... I do not observe any 0s.. It gives a 1 for every observation no matter what...
What am I doing wrong?
I want to generate a dummy variable that gives a value of 1 if the value of a variable is between the range of the 5th and 95th percentile, 0 otherwise
I did the following:
Code:
gen X_inrange = inrange(X, r(p5), r(p95))
What am I doing wrong?
Comment