Creating some variables [message #28721] |
Thu, 29 February 2024 04:57 ![Go to next message Go to previous message](/theme/default/images/down.png) |
shakim
Messages: 10 Registered: January 2021
|
Member |
|
|
Dear Sara and SPA experts,
I am working with the 2021/22 Ethiopia SPA survey and looking to create three variable equipment for high level disinfection,sterilization equipment (table 3.5.1) and client latrine (table 3.3) using the footnotes and questionnaire. Unfortunately, I am not getting the % of the final report table.
My STATA code is:
gen wt=facwt/1000000
*Sterilization equipment
gen ste=0
replace ste=1 if (q201==1 | q201==2) & ((q501a_04==1 & q501b_04==1) | (q501a_01==1 & q501b_01==1) | (q501a_02==1 & q501b_02==1 & q501a_07==1 & q501b_07==1))
tab ste [iw=wt]
*Equipment for high level disinfection
gen hilvldis=0
replace hilvldis=1 if (q201==1 | q201==2) & ((q501a_4==1 & q501b_4==1) | (q501a_5==1) | (q501a_9==1 & inrange(q502g_5,3,5)))
tab hilvldis [iw=wt]
*Client latrine
gen latrine=0
replace latrine=1 if (q620==11|q620==12)&(q620==21)|(q620==22|q620==31)
label var latrine "client latrine"
tab latrine [iw=wt],m
Do I need to consider anything else? Would it be possible to get the codes of these variables? I would greatly appreciate any help with this matter.
Many thanks
|
|
|