The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Weighting data » When to use iweight and pweight in stata
Re: When to use iweight and pweight in stata [message #13261 is a reply to message #13199] Tue, 10 October 2017 10:34 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3199
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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Weights for analysis of HIV+/HIV- urban and rural populations
Next Topic: De-normalizing weights and svyset command in Stata
Goto Forum:
  


Current Time: Sat Nov 30 23:39:24 Coordinated Universal Time 2024