The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Service Provision Assessment (SPA) » Creating two variable (SPA )
Re: Creating two variable [message #23376 is a reply to message #23369] Tue, 31 August 2021 02:35 Go to previous messageGo to previous message
rasel is currently offline  rasel
Messages: 2
Registered: August 2021
Member
Dear Sara,

Thanks for your help and I was able to recreate variables.
Now, I want to create the variable regular electricity of table 3.3 in DR Congo SPA 2017-18. I have tried with the following codes:
gen sw=facwt/1000000
gen q343a=regexm(q343, "A")
gen q343b=regexm(q343, "B")
gen q343c=regexm(q343, "C")
gen q343d=regexm(q343, "D")
gen ect=0
replace ect=1 if q340==1 & q341==1
replace ect=1 if (q343a==1 | q343b==1) & q345==1 & q346==1
replace ect=1 if q343c==1
replace ect=1 if q343d==1
tab ect [iw=sw]
But unable to match the % with the report table. I wish your help to create this variable.

Regards,
Rasel
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Creating some variables
Next Topic: SPA variables
Goto Forum:
  


Current Time: Mon Apr 29 09:53:05 Coordinated Universal Time 2024