Bookmark and Share

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

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

st: trying to understand collapse and weights

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

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.
*   For searches and help try:

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