Re: Replicating table [message #28795 is a reply to message #28722] |
Sat, 09 March 2024 06:36 |
SaraDHS
Messages: 46 Registered: December 2020
|
Member |
|
|
Hello,
For all of these indicators, note that the title of the table indicates that health posts are excluded.
This is the main issue. Most of your codes are correct, you just need to add this in the tabulation line. For a couple of the indicators I have added corrections or clarifications and commented out your code below.
Best,
Sara
gen wt=facwt/1000000
*X-ray machine - you have this variable already in the dataset at factbxray, so just tab that and exclude health posts
tab factbxray if factype!=5 [iw=wt],m
/*gen xray=0
replace xray=1 if ((q881b_1==1 & q881c_1==1) | (q881b_2==1 & q881c_2==1 & q881b_3==1))
tab xray [iw=wt]
*/
*full blood count
gen blood_count=0
replace blood_count=1 if (q802b_1==1 & q802c_1==1)
tab blood_count if factype!=5 [iw=wt]
/*gen blood_count=0
replace blood_count=1 if (q802a_1==1 & q802b_1==1 & q802c_1==1)
tab blood_count [iw=wt]
*/
*Blood glucose ok - remove health posts - although you can just use bloodgluc, no need to create a new variable
recode bloodgluc 9=.
recode bloodgluc (1=1 "available") (0=0 "not available"), gen (blood_glucose)
label variable blood_glucose "Blood glucose"
tab blood_glucose if factype!=5 [iw=wt],m
*liver or renal function test
gen lrt=0
replace lrt =1 if q834==1 & q835==1
tab lrt if factype!=5 [iw=wt
Sara Riese, PhD
Senior Demographic and Health Researcher, DHS Program
|
|
|