Home » Topics » HIV » Gambia DHS 2013
Re: Gambia DHS 2013 [message #14735 is a reply to message #11161] |
Wed, 02 May 2018 20:33 |
sngacksowe@yahoo.com
Messages: 4 Registered: April 2018 Location: UmeƄ University, Sweden
|
Member |
|
|
Hi User,
The following steps may also help.
1. Merge the women and hiv dataset.
2. Merge the men and hiv datasets.
3. Append the new men and womendata sets which were form from the previously merged datasets above.
I did mine as follows:
clear all
version 13.1
set more off
*To locate the datasets
cd "C:\Users\oneness\Desktop\First year thesis\Sarata\"
*MERGING THE DATASETS
*To call the individual/women's dataset
use "GMIR60FL.DTA", clear
sort v001 v002 v003
generate gender = 2
save "women.dta", replace
*To call the HIV dataset
use "GMAR60FL.DTA", clear
ren hivclust v001
ren hivnumb v002
ren hivline v003
sort v001 v002 v003
save "hiv.dta", replace
*Merge women and HIV datasets
merge 1:1 v001 v002 v003 using "women.dta"
drop if hiv03 == .
*keep if _merge == 3
save "women_hiv", replace
*To call the men's dataset
use "GMMR60FL.DTA", clear
generate gender = 1
ren mv* v*
ren mg1* g1*
ren mcas* cas*
sort v001 v002 v003
save "men.dta", replace
*Merge men and HIV datasets
merge 1:1 v001 v002 v003 using "hiv.dta"
drop if hiv03 == .
*keep if _merge == 3
save "men_hiv", replace
*To append the women and men data sets.
use "men_hiv.dta", clear
append using "women_hiv.dta"
save "men_women_hiv.dta", replace
|
|
|
Goto Forum:
Current Time: Fri Dec 13 12:28:26 Coordinated Universal Time 2024
|