[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: A problem with egen??
Dear Statalist users,
I am having a problem in using the egen command.My
dataset has many countries. I want to generate a
variable which takes value= 5th (or any) percentile
value of another variable for each country. I tried
by country:egen X_5pct=pct(X), p(5)
I am getting the same value for all the countries,
which is the 5th percentile value of the entire
sample. Whereas I want the 5th percentile value for
each country separately.
However if I do without specifying the option p(5)
by country:egen X_5pct=pct(X)
Then I get the median (50th percentile value) for each
country separately. But whenever I tried with the
option p(5), I get the value for the entire sample.
Please help me out.
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
* For searches and help try: