Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Computing proportions within generated reference groups


From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: Computing proportions within generated reference groups
Date   Tue, 30 Aug 2011 17:07:45 +0200

On Tue, Aug 30, 2011 at 4:54 PM, Namrata Chindarkar wrote:
> For instance, for the income variable, I want to compute the
> proportion of individuals that have income greater than income of
> individual "i" in each reference group. As an example if group1 has 5
> individuals with incomes 30, 20, 10, 60, and 70 respectively, I want
> to be able to get values 0.4, 0.6, 0.8, 0.2, and 0 respectively.

See -help cumul- and this example:

*------------ begin example -----------
clear
input income
30
20
10
60
70
end

cumul income, gen(p)
replace p = 1-p
list
*----------- end example -------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )

Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany


http://www.maartenbuis.nl
--------------------------
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index