The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Service Provision Assessment (SPA) » Replicating table 3.3 and 3.7 in Tanzania SPA 2014-15 (2014-15 TSPA)
Re: Replicating table 3.3 and 3.7 in Tanzania SPA 2014-15 [message #23328 is a reply to message #23317] Tue, 24 August 2021 14:28 Go to previous messageGo to previous message
foysal is currently offline  foysal
Messages: 9
Registered: August 2021
Member
Dear Sara,

Thanks for your response and I was able to get the same % as tables except the variable- X ray machine, full blood count, liver or renal function test".

Here is the codes with the output.
gen wt=facwt/1000000
*Xray machine
gen xray=.
replace xray=0 if inrange(factype,1,7) | inrange(factype,12,14)
replace xr=1 if xray==0 & ((q881b_1==1 & q881c_1==1) | (q881b_2==1 & q881c_2==1 & q881b_3==1 & q881c_3==1))
tab xray [iw=wt]


xray | Freq. Percent Cum.
------------+-----------------------------------
0 | 49.745353 37.16 37.16
1 | 84.1219059 62.84 100.00
------------+-----------------------------------
Total | 133.867259 100.00

In the report table the % is 63.0 (table 3.7.3).
*Full blood count
gen blood_count=.
replace blood_count=0 if inrange(factype,1,7) | inrange(factype,12,14)
replace blood_count=1 if blood_count==0 & ((q834==1 & q835==1) | (q802eb_1==1 & q802ec_1==1 & q802eb_2==1 & q802eb_3==1 & q802ec_3==1))
tab blood_count [iw=wt]

blood_count | Freq. Percent Cum.
------------+-----------------------------------
0 | 35.4440796 26.48 26.48
1 | 98.4231793 73.52 100.00
------------+-----------------------------------
Total | 133.867259 100.00
In the final report table the % is 66.9 (table 3.7.3).
**Liver or renal function test
gen lrt=.
replace lrt=0 if inrange(factype,1,7) | inrange(factype,12,14)
replace lrt =1 if lrt==0 & q833==1 & ((q834==1 & q835==1) |(q835c==1 & q835d==1))
tab lrt [iw=wt]

lt | Freq. Percent Cum.
------------+-----------------------------------
0 | 70.8263274 52.91 52.91
1 | 63.0409315 47.09 100.00
------------+-----------------------------------
Total | 133.867259 100.00

In the report the % is 46.5 (table 3.7.3).
How can I get the same % of this variables as the table?

Regards,
Shakim
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Replicating table in DR Congo SPA 2017-18
Next Topic: Creating some variables
Goto Forum:
  


Current Time: Wed Nov 13 18:22:45 Coordinated Universal Time 2024