Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Re: percentages (p75)


From   [email protected]
To   [email protected]
Subject   Re: st: Re: percentages (p75)
Date   Mon, 30 Apr 2007 02:49:53 -0700

Dear Professor Lauritsen,

Do you know how to take the "liberals" and view a histogram of only their income, and then superimpose it on the general population income?

Tusind Tak! (if I remember my Danish well)

Chris


Quoting Jens Lauritsen <[email protected]>:


I want me to create a "liberal" variable and a "conservative" variable
by isolating the people who score in the top 25th percentile in a
composite personal freedoms variable and the bottom 25th percentile
This is quite easy by using the result variables, following summarize.
Notice the option ", d": If you forget the percentiles will not be available

E.g. for a variable AGE:

summ AGE ,d

..... output cut out .....
75%           48             74
..... output cut out .....

* You can also see the result variables by:

return list

scalars:
..... output cut out .....
               r(p50) =  41
               r(p75) =  48
..... output cut out .....

* to create your indicators:
gen high = (AGE >= r(p75) )
gen low =  ( AGE < r(p25) )

list h AGE

      high  AGE
   1.    0   47
   2.    1   49
..... output cut out .....

regards

Jens Lauritsen
Southern Denmark University, Denmark
Coordinator and initiator of EpiData Project http://www.epidata.dk




*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index