The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Level-weights calculation (Approximation of level-weights)
Re: Level-weights calculation [message #25137 is a reply to message #25132] Fri, 02 September 2022 13:28 Go to previous messageGo to previous message
jessy is currently offline  jessy
Messages: 8
Registered: August 2022
Member
thank you for the timely response.
actually my biggest challenge is that the number of EAs recorded in table A.2 (30) are less by four those listed in v022 (34).so we i go ahead and generate total number of census clusters by strata, I get 86 MISSING VALUES. i actually feel iam doing something wrong.

*** 1.1: Calculating the total number of completed clusters a_h^c in stratum h for all strata.
gen a_c_h=.
quietly levelsof v023, local(lstrata)
quietly foreach ls of local lstrata {
tab v021 if v023==`ls', matrow(T)
scalar stemp=rowsof(T)
replace a_c_h=stemp if v023==`ls'
}

*** 1.2:
* A_h total number of census clusters by strata***found in Table A.2 in the survey final report
gen A_h = 0
replace A_h = 3125 if v023 == 1
replace A_h = 2597 if v023 == 2
replace A_h = 5944 if v023 == 3
replace A_h = 1547 if v023 == 4
replace A_h = 6608 if v023 == 5
replace A_h = 865 if v023 == 6
replace A_h = 5978 if v023 == 7
replace A_h = 1078 if v023 == 8
replace A_h = 2635 if v023 == 9
replace A_h = 795 if v023 == 10
replace A_h = 6975 if v023 == 11
replace A_h = 301 if v023 == 12
replace A_h = 3275 if v023 == 13
replace A_h = 179 if v023 == 14
replace A_h = 2170 if v023 == 15
replace A_h = 482 if v023 == 16
replace A_h = 4947 if v023 == 17
replace A_h = 581 if v023 == 18
replace A_h = 3320 if v023 == 19
replace A_h = 509 if v023 == 20
replace A_h = 5100 if v023 == 21
replace A_h = 609 if v023 == 22
replace A_h = 3016 if v023 == 23
replace A_h = 883 if v023 == 24
replace A_h = 4394 if v023 == 25
replace A_h = 966 if v023 == 26
replace A_h = 5894 if v023 == 27
replace A_h = 440 if v023 == 28
replace A_h = 3249 if v023 == 29


*** 1.3: Add the average number of households per cluster by sampling strata according to the census data M ̅_h.obtained from table A:2 in the final report
* M_h average number of households per cluster by sampling strata
gen M_h = 0
replace M_h = 132 if v023 == 1
replace M_h = 147 if v023 == 2
replace M_h = 111 if v023 == 3
replace M_h = 143 if v023 == 4
replace M_h = 94 if v023 == 5
replace M_h = 139 if v023 == 6
replace M_h = 99 if v023 == 7
replace M_h = 48 if v023 == 8
replace M_h = 115 if v023 == 9
replace M_h = 83 if v023 == 10
replace M_h = 43 if v023 == 11
replace M_h = 111 if v023 == 12
replace M_h = 88 if v023 == 13
replace M_h = 127 if v023 == 14
replace M_h = 65 if v023 == 15
replace M_h = 93 if v023 == 16
replace M_h = 75 if v023 == 17
replace M_h = 108 if v023 == 18
replace M_h = 70 if v023 == 19
replace M_h = 110 if v023 == 20
replace M_h = 81 if v023 == 21
replace M_h = 124 if v023 == 22
replace M_h = 115 if v023 == 23
replace M_h = 115 if v023 == 24
replace M_h = 98 if v023 == 25
replace M_h = 140 if v023 == 26
replace M_h = 74 if v023 == 27
replace M_h = 106 if v023 == 28
replace M_h = 81 if v023 == 29


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Skilled assistance at birth- Kenya and Senegal
Next Topic: Unique ID Error
Goto Forum:
  


Current Time: Sat Apr 20 01:46:03 Coordinated Universal Time 2024