Home » Data » Weighting data » When to use iweight and pweight in stata
|
Re: When to use iweight and pweight in stata [message #13189 is a reply to message #13156] |
Mon, 02 October 2017 14:27   |
Bridgette-DHS
Messages: 3230 Registered: February 2013
|
Senior Member |
|
|
Following is a response from Senior DHS Stata Specialist, Tom Pullum:
My rule is to always use pweight if it is accepted. Unfortunately there are some commands in Stata, such as tabulate and summarize, that will not accept pweight. Those commands will accept iweights, and for them I will use, say, iweight=v005/1000000. The division by 1,000,000 will give weights with an average value of 1. But if you want to use tabulate with an option such as chi2, you can't. Even if you use svyset and pweight, you cannot do tabulate and chi2. So far as I know, virtually all of the estimation commands will accept pweights. (There are some esoteric exceptions and I expect them to evolve to accept pweights in the future.)
You say that "the DHS manual recommends one to use iweight". Which manual are you referring to? I cannot find that recommendation.
I hope other users will add suggestions.
|
|
|
|
|
|
|
|
Re: When to use iweight and pweight in stata [message #13261 is a reply to message #13199] |
Tue, 10 October 2017 10:34  |
Bridgette-DHS
Messages: 3230 Registered: February 2013
|
Senior Member |
|
|
A response from DHS Stata Specialist, Tom Pullum:
Below I will insert some Stata lines that you can run after you have opened a KR file. If you want to adjust for weights, clustering, and stratification in a table, the best way (in my opinion!) is with logit (if one of the variables is binary) or mlogit (if both variables have more than two categories). You cannot get a chi square, but you can get the p-value for an F, which will be an equivalent test of the significance of the association. Note that the correspondence is with a likelihood ratio chi-square, rather than a Pearson chi-square. The correspondences between the following approaches with Stata add to my confidence in how Stata handles weights. You could check whether you get the same correspondences with SPSS.
gen stunted=.
replace stunted=0 if hw70<600
replace stunted=1 if hw70<-200
gen age=b8
replace age=. if v008-b3<6
tab stunted age, lrchi2
scalar pvalue=r(p_lr)
scalar list pvalue
logit stunted i.age
scalar pvalue=e(p)
scalar list pvalue
svyset v021 [pweight=v005], strata(v022) singleunit(centered)
svy: logit stunted i.age
scalar pvalue=e(p)
scalar list pvalue
|
|
|
Goto Forum:
Current Time: Thu May 8 06:54:38 Coordinated Universal Time 2025
|