The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » IPUMS Demographic and Health Surveys (IPUMS-DHS)  » Melogit and Weights
Re: Melogit and Weights [message #19730 is a reply to message #19723] Thu, 06 August 2020 00:40 Go to previous messageGo to previous message
Yawo is currently offline  Yawo
Messages: 45
Registered: February 2019
Member
Hi Trevor:

Thanks very much for your assistance. Here is the code I've been using:


/* creating psu and strata for pooled samples/countries */
egen psupool= group(idhspsu sample)
egen stratapool= group(idhsstrata sample)

gen weight=hiv05/1000000
gen weight2=1
svyset psupool, weight(weight) strata(stratapool) singleunit(centered) || _n, weight(weight2)


My data still shows non-constant weights in some of the PSU's

Below is a sample of 4 PSU's from Angola. I checked and many other data (including freshly downloaded versions from DHS) have non-constant weights within PSUs.

Thanks again, and looking forward to any further advice from you.

best - cY


. list sample idhspsu psupool weight weight2 v005 in 200/250

. list sample idhspsu psupool weight weight2 v005 in 200/250
[font=Courier]
     +--------------------------------------------------------------------+
     |      sample      idhspsu   psupool     weight   weight2       v005 |
     |--------------------------------------------------------------------|
200. | Angola 2015   2401000011        11   3.262758         1   2.964534 |
201. | Angola 2015   2401000011        11   2.894893         1   2.836539 |
202. | Angola 2015   2401000011        11   2.894893         1   2.836539 |
203. | Angola 2015   2401000011        11   3.262758         1   2.964534 |
204. | Angola 2015   2401000011        11   3.262758         1   2.964534 |
     |--------------------------------------------------------------------|
205. | Angola 2015   2401000011        11   2.894893         1   2.836539 |
206. | Angola 2015   2401000011        11   2.894893         1   2.836539 |
207. | Angola 2015   2401000011        11   3.262758         1   2.964534 |
208. | Angola 2015   2401000011        11   3.262758         1   2.964534 |
209. | Angola 2015   2401000011        11   3.262758         1   2.964534 |
     |--------------------------------------------------------------------|
210. | Angola 2015   2401000011        11   3.262758         1   2.964534 |
211. | Angola 2015   2401000011        11   3.262758         1   2.964534 |
212. | Angola 2015   2401000011        11   2.894893         1   2.836539 |
213. | Angola 2015   2401000011        11   3.262758         1   2.964534 |
214. | Angola 2015   2401000011        11   2.894893         1   2.836539 |
     |--------------------------------------------------------------------|
215. | Angola 2015   2401000011        11   2.894893         1   2.836539 |
216. | Angola 2015   2401000011        11   2.894893         1   2.836539 |
217. | Angola 2015   2401000011        11   3.262758         1   2.964534 |
218. | Angola 2015   2401000011        11   3.262758         1   2.964534 |
219. | Angola 2015   2401000011        11   2.894893         1   2.836539 |
     |--------------------------------------------------------------------|
220. | Angola 2015   2401000012        12    .396283         1     .41734 |
221. | Angola 2015   2401000012        12     .40295         1    .437145 |
222. | Angola 2015   2401000012        12     .40295         1    .437145 |
223. | Angola 2015   2401000012        12     .40295         1    .437145 |
224. | Angola 2015   2401000012        12    .396283         1     .41734 |
     |--------------------------------------------------------------------|
225. | Angola 2015   2401000012        12    .396283         1     .41734 |
226. | Angola 2015   2401000012        12    .396283         1     .41734 |
227. | Angola 2015   2401000012        12     .40295         1    .437145 |
228. | Angola 2015   2401000012        12    .396283         1     .41734 |
229. | Angola 2015   2401000012        12     .40295         1    .437145 |
     |--------------------------------------------------------------------|
230. | Angola 2015   2401000012        12     .40295         1    .437145 |
231. | Angola 2015   2401000012        12     .40295         1    .437145 |
232. | Angola 2015   2401000012        12     .40295         1    .437145 |
233. | Angola 2015   2401000012        12     .40295         1    .437145 |
234. | Angola 2015   2401000012        12    .396283         1     .41734 |
     |--------------------------------------------------------------------|
235. | Angola 2015   2401000012        12     .40295         1    .437145 |
236. | Angola 2015   2401000012        12    .396283         1     .41734 |
237. | Angola 2015   2401000012        12     .40295         1    .437145 |
238. | Angola 2015   2401000012        12     .40295         1    .437145 |
239. | Angola 2015   2401000013        13    .586726         1    .595693 |
     |--------------------------------------------------------------------|
240. | Angola 2015   2401000013        13    .547652         1    .604053 |
241. | Angola 2015   2401000013        13    .586726         1    .595693 |
242. | Angola 2015   2401000013        13    .547652         1    .604053 |
243. | Angola 2015   2401000013        13    .586726         1    .595693 |
244. | Angola 2015   2401000013        13    .547652         1    .604053 |
     |--------------------------------------------------------------------|
245. | Angola 2015   2401000013        13    .547652         1    .604053 |
246. | Angola 2015   2401000013        13    .586726         1    .595693 |
247. | Angola 2015   2401000013        13    .547652         1    .604053 |
248. | Angola 2015   2401000013        13    .547652         1    .604053 |
249. | Angola 2015   2401000014        14    .503401         1    .477899 |
     |--------------------------------------------------------------------|
250. | Angola 2015   2401000014        14    .465081         1    .491306 |
     +--------------------------------------------------------------------+[/font]

[Updated on: Thu, 06 August 2020 00:42]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Weights and Strata for Pooled Samples
Next Topic: Merging DHS with IPUMS-DHS to get harmonized districts
Goto Forum:
  


Current Time: Thu Apr 18 00:24:40 Coordinated Universal Time 2024