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]

st: trying to understand collapse and weights


From   Nirina F <[email protected]>
To   [email protected]
Subject   st: trying to understand collapse and weights
Date   Fri, 28 Feb 2014 17:15:01 -0500

Hi,
I am using panel data over countries year.
Each country has various income variable but I wanted to use that as weights.

collapse $xvar [iw=income] , by(year)
The results I get make sense but I wanted to understand what is the
logic behind this command with [iw]
So I tried to test Stat and used the weights with collapse (sum) and I
got huge numbers for my xvars
 collapse (sum)  $xvar [iw=income] , by(year).
I would like to make sure that the following command is doing the
right weighting which is country1 has 30% of the income in the sample
in a particular year for example.

collapse $xvar [iw=income] , by(year)

Should I have created a share of income for each particular year and
country before collapsing.
Thanks,
Nina
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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