Home » Topics » HIV » comprehensive knowledge of HIV AIDS
Re: comprehensive knowledge of HIV AIDS [message #16394 is a reply to message #16392] |
Mon, 07 January 2019 08:47 |
Mlue
Messages: 92 Registered: February 2017 Location: North West
|
Senior Member |
|
|
Hello kamal.chaulagain123@gmail
Please see the code below... The code is a bit different to the ones shown above.
I assume you are looking for the code that replicates the figures in the Nepal DHS of 2016.
WOMEN
/*
COMPREHENSIVE KNOWLEDGE ABOUT HIV
WOMEN FILE
NEPAL DHS 2016
*/
clear all
set more off
set maxvar 9000
set mem 1g
set matsize 800
cd "..."
use "NPIR7HFL", clear
set more off
version 14.2
dtaversion "NPIR7HFL.dta"
pwd
***************************************************************************
** WEIGHT VARIABLE
gen weight = v005/1000000
********************************************************************************
** SURVEY SET
gen psu = v021
gen strata = v023
svyset psu [pw = weight], strata(strata) vce(linearized)
********************************************************************************
// RENAME
rename v013 age
rename v106 education
rename v190 wealth
rename v025 residence
rename v024 region
rename sdist district
////////////////////////////////////////////////////////////////////////////////
/*
** VARIABLES
v756 A healthy looking person can have HIV (women)
v754jp Can get HIV from mosquito bites (women)
v754wp Can get HIV by sharing food with person who has AIDS (women)
v823 Can get HIV by witchcraft or supernatural means (women)
v005 Woman's individual sample weight
********************************************************************************
mv756 A healthy looking person can have HIV (men)
mv754jp Can get HIV from mosquito bites (men)
mv754wp Can get HIV by sharing food with person who has AIDS (men)
mv823 Can get HIV by witchcraft or supernatural means (men)
mv005 Man's individual sample weigh
*/
cap drop age2
recode v012 (15/24=1 "15-24") (25/29=2 "25-29") (30/39=3 "30-39") (40/49=4 "40-49"), gen(age2)
label var age2 "Current age"
label val age2 age2
********************************************************************************
** INDICATORS
** 01. A HEALTHY-LOOKING PERSON CAN HAVE THE AIDS VIRUS
recode v756 (1=1 "Yes") (else=0 "No"), gen(healthy_look_HIV)
label var healthy_look_HIV "Knows that a healthy-looking person can have HIV"
label val healthy_look_HIV healthy_look_HIV
svy: tab age2 healthy_look_HIV, count format(%4.0f)
svy: tab age2 healthy_look_HIV, percent format(%4.1f) row
*****************
** 02. HIV CANNOT BE TRANSMITTED BY MOSQUITO BITES
recode v754jp (0=1 "Yes") (else=0 "No"), gen(transmit_mosquito_bites)
label var transmit_mosquito_bites "Knows that HIV cannot be transmitted by mosquito bites"
label val transmit_mosquito_bites transmit_mosquito_bites
svy: tab age2 transmit_mosquito_bites, count format(%4.0f)
svy: tab age2 transmit_mosquito_bites, percent format(%4.1f) row
*****************
/*
** 03. HIV CANNOT BE TRANSMITTED BY SUPERNATURAL MEANS
recode v823 (0=1 "Yes") (else=0 "No"), gen(transmit_witchcraft)
label var transmit_witchcraft "Knows that HIV cannot be transmitted by supernatural means (witchcraft)"
label val transmit_witchcraft transmit_witchcraft
svy: tab age2 transmit_witchcraft, count format(%4.0f)
svy: tab age2 transmit_witchcraft, percent format(%4.1f) row
*/
*****************
** 03. HIV CANNOT BE TRANSMITTED BY TOUCHING SOMEONE WHO HAS HIV
recode s1006 (0=1 "Yes") (else=0 "No"), gen(transmit_touching)
label var transmit_touching "Knows that HIV cannot be transmitted by touching someone who has HIV"
label val transmit_touching transmit_touching
svy: tab age2 transmit_touching, count format(%4.0f)
svy: tab age2 transmit_touching, percent format(%4.1f) row
*****************
** 04. A PERSON CANNOT BECOME INFECTED BY SHARING FOOD WITH A PERSON WHO HAS HIV
recode v754wp (0=1 "Yes") (else=0 "No"), gen(sharing_food_HIV)
label var sharing_food_HIV "Knows that a person cannot become infected by sharing food with a person who has HIV"
label val sharing_food_HIV sharing_food_HIV
svy: tab age2 sharing_food_HIV, count format(%4.0f)
svy: tab age2 sharing_food_HIV, percent format(%4.1f) row
*****************
** 05. Persons who say that a healthy looking person can have the AIDS virus and who reject the two most common local misconceptions
/*
Two most common local misconceptions: the AIDS virus can be transmitted by
mosquito bites and a person can become infected by sharing food with a
person who has AIDS.
*/
gen reject_misconceptions = 0
replace reject_misconceptions = 1 if healthy_look_HIV == 1 & (transmit_mosquito_bites == 1 & sharing_food_HIV == 1)
label define reject_misconceptions 0"No" 1"Yes"
label var reject_misconceptions "A healthy looking person can have the AIDS virus - reject the two most common local misconceptions"
label val reject_misconceptions reject_misconceptions
svy: tab age2 reject_misconceptions, count format(%4.0f)
svy: tab age2 reject_misconceptions, percent format(%4.1f) row
** ========================================================================== **
** ========================================================================== **
** ========================================================================== **
** 06. HIV PREVENTION METHODS
cap drop prevention_methods
gen prevention_methods = 0
replace prevention_methods = 1 if v754cp == 1 & v754dp == 1
label define prevention_methods 0"No" 1"Yes"
label var prevention_methods "Knows both prevention methods"
label val prevention_methods reject_misconceptions
svy: tab age2 prevention_methods, count format(%4.0f)
svy: tab age2 prevention_methods, percent format(%4.1f) row
*****************
** 07. COMPEHENSIVE KNOWLEDGE ABOUT HIV
/*
Two most common local misconceptions: the AIDS virus can be transmitted by
mosquito bites and a person can become infected by sharing food with a
person who has AIDS.
*/
cap drop comprehensive_HIV
gen comprehensive_HIV = 0
replace comprehensive_HIV = 1 if (prevention_methods == 1 & healthy_look_HIV == 1) & (transmit_mosquito_bites == 1 & sharing_food_HIV == 1)
label define comprehensive_HIV 0"No" 1"Yes"
label var comprehensive_HIV ""
label val comprehensive_HIV comprehensive_HIV
svy: tab age2 comprehensive_HIV, count format(%4.0f)
svy: tab age2 comprehensive_HIV, percent format(%4.1f) row
** ========================================================================== **
keep if healthy_look_HIV != .
** ========================================================================== **
exit
MEN
/*
COMPREHENSIVE KNOWLEDGE ABOUT HIV
MEN FILE
NEPAL DHS 2016
*/
clear all
set more off
set maxvar 9000
set mem 1g
set matsize 800
cd "..."
use "NPMR7HFL", clear
set more off
version 14.2
dtaversion "NPMR7HFL.dta"
pwd
***************************************************************************
** WEIGHT VARIABLE
gen weight = mv005/1000000
********************************************************************************
** SURVEY SET
gen psu = mv021
gen strata = mv023
svyset psu [pw = weight], strata(strata) vce(linearized)
********************************************************************************
// RENAME
rename mv013 age
rename mv106 education
rename mv190 wealth
rename mv025 residence
rename mv024 region
rename smdist district
////////////////////////////////////////////////////////////////////////////////
/*
** VARIABLES
mv756 A healthy looking person can have HIV (men)
mv754jp Can get HIV from mosquito bites (men)
sm706 can get hiv by touching someone
mv754wp Can get HIV by sharing food with person who has AIDS (men)
mv823 Can get HIV by witchcraft or supernatural means (men)
mv005 Man's individual sample weigh
*/
cap drop age2
recode mv012 (15/24=1 "15-24") (25/29=2 "25-29") (30/39=3 "30-39") (40/49=4 "40-49"), gen(age2)
label var age2 "Current age"
label val age2 age2
********************************************************************************
** INDICATORS
** 01. A HEALTHY-LOOKING PERSON CAN HAVE THE AIDS VIRUS
recode mv756 (1=1 "Yes") (else=0 "No"), gen(healthy_look_HIV)
label var healthy_look_HIV "Knows that a healthy-looking person can have HIV"
label val healthy_look_HIV healthy_look_HIV
svy: tab age2 healthy_look_HIV, count format(%4.0f)
svy: tab age2 healthy_look_HIV, percent format(%4.1f) row
*****************
** 02. HIV CANNOT BE TRANSMITTED BY MOSQUITO BITES
recode mv754jp (0=1 "Yes") (else=0 "No"), gen(transmit_mosquito_bites)
label var transmit_mosquito_bites "Knows that HIV cannot be transmitted by mosquito bites"
label val transmit_mosquito_bites transmit_mosquito_bites
svy: tab age2 transmit_mosquito_bites, count format(%4.0f)
svy: tab age2 transmit_mosquito_bites, percent format(%4.1f) row
*****************
/*
** 03. HIV CANNOT BE TRANSMITTED BY SUPERNATURAL MEANS
recode mv823 (0=1 "Yes") (else=0 "No"), gen(transmit_witchcraft)
label var transmit_witchcraft "Knows that HIV cannot be transmitted by supernatural means (witchcraft)"
label val transmit_witchcraft transmit_witchcraft
svy: tab age2 transmit_witchcraft, count format(%4.0f)
svy: tab age2 transmit_witchcraft, percent format(%4.1f) row
*/
*****************
** 03. HIV CANNOT BE TRANSMITTED BY TOUCHING SOMEONE WHO HAS HIV
recode sm706 (0=1 "Yes") (else=0 "No"), gen(transmit_touching)
label var transmit_touching "Knows that HIV cannot be transmitted by touching someone who has HIV"
label val transmit_touching transmit_touching
svy: tab age2 transmit_touching, count format(%4.0f)
svy: tab age2 transmit_touching, percent format(%4.1f) row
*****************
** 04. A PERSON CANNOT BECOME INFECTED BY SHARING FOOD WITH A PERSON WHO HAS HIV
recode mv754wp (0=1 "Yes") (else=0 "No"), gen(sharing_food_HIV)
label var sharing_food_HIV "Knows that a person cannot become infected by sharing food with a person who has HIV"
label val sharing_food_HIV sharing_food_HIV
svy: tab age2 sharing_food_HIV, count format(%4.0f)
svy: tab age2 sharing_food_HIV, percent format(%4.1f) row
*****************
** 05. Persons who say that a healthy looking person can have the AIDS virus and who reject the two most common local misconceptions
/*
Two most common local misconceptions: the AIDS virus can be transmitted by
mosquito bites and a person can become infected by sharing food with a
person who has AIDS.
*/
gen reject_misconceptions = 0
replace reject_misconceptions = 1 if healthy_look_HIV == 1 & (transmit_mosquito_bites == 1 & sharing_food_HIV == 1)
label define reject_misconceptions 0"No" 1"Yes"
label var reject_misconceptions "A healthy looking person can have the AIDS virus - reject the two most common local misconceptions"
label val reject_misconceptions reject_misconceptions
svy: tab age2 reject_misconceptions, count format(%4.0f)
svy: tab age2 reject_misconceptions, percent format(%4.1f) row
** ========================================================================== **
** ========================================================================== **
** ========================================================================== **
** 06. HIV PREVENTION METHODS
cap drop prevention_methods
gen prevention_methods = 0
replace prevention_methods = 1 if mv754cp == 1 & mv754dp == 1
label define prevention_methods 0"No" 1"Yes"
label var prevention_methods "Knows both prevention methods"
label val prevention_methods reject_misconceptions
svy: tab age2 prevention_methods, count format(%4.0f)
svy: tab age2 prevention_methods, percent format(%4.1f) row
*****************
** 07. COMPEHENSIVE KNOWLEDGE ABOUT HIV
/*
Two most common local misconceptions: the AIDS virus can be transmitted by
mosquito bites and a person can become infected by sharing food with a
person who has AIDS.
*/
cap drop comprehensive_HIV
gen comprehensive_HIV = 0
replace comprehensive_HIV = 1 if (prevention_methods == 1 & healthy_look_HIV == 1) & (transmit_mosquito_bites == 1 & sharing_food_HIV == 1)
label define comprehensive_HIV 0"No" 1"Yes"
label var comprehensive_HIV ""
label val comprehensive_HIV comprehensive_HIV
svy: tab age2 comprehensive_HIV, count format(%4.0f)
svy: tab age2 comprehensive_HIV, percent format(%4.1f) row
** ========================================================================== **
keep if healthy_look_HIV != .
** ========================================================================== **
exit
|
|
|
Goto Forum:
Current Time: Wed Dec 11 23:49:22 Coordinated Universal Time 2024
|