Survey Weights

6 views
Skip to first unread message

Jia De Gedeon Lim

unread,
Jun 5, 2013, 11:38:03 PM6/5/13
to income-dynam...@googlegroups.com
Hey Everyone,

At some point in our research assignments we might need to use probability weights so I've taken the liberty to include some useful code here from Ajay's solowhh_factpred.do. (There might be other bits of useful code lying around that I didn't notice)

//////////////////////
///(1) weighting options

//Do we want to attempt to reweight or not?
local useweights 0

local weightfolder1 stylized
local weightfolder0 stylized_noweight

//////////////////////
//(2) If we don't want weights, equalize them
if !`useweights' {
    foreach var of varlist weight71 wt82 weight99 {
        replace `var' = 1
    }
}

I think that the first part "local useweights 0" basically states whether or not you want to use weights in your analysis. The second part sets all weights to 1 if you don't want to use weights for your analysis. In this way, you can include the command [pweight=___] in your entire code and just change the macro `useweights' to 0 or 1 (?) if and when you want to run weighted or unweighted regressions etc.

Also, this is a nice FAQ that explains how to construct variables containing weighted summary statistics since commands like egen doesn't support weights (although the package -egenmore- might be useful): http://www.stata.com/support/faqs/data-management/weighted-group-summary-statistics/

Thanks.

Best,
Gedeon

Jia De Gedeon Lim

unread,
Jun 6, 2013, 1:48:08 AM6/6/13
to income-dynam...@googlegroups.com
Hi Everyone,

Sorry for the spam. The "summarize" command doesn't work with pweights but according to http://www.stata.com/support/faqs/statistics/weights-and-summary-statistics/, the use of aweights will give us the same values if we are interested in only point estimates. It also goes into detail about the use of weights; how the summarize command works; and how the svy: mean command works etc.

Best,
Gedeon
Reply all
Reply to author
Forward
0 new messages