The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Domestic Violence » Matching the Kenya 2014 DHS domestic violence data
Matching the Kenya 2014 DHS domestic violence data [message #11175] Tue, 15 November 2016 05:23 Go to next message
npolle is currently offline  npolle
Messages: 6
Registered: August 2016
Location: MOMBASA, KENYA
Member
I am using the 2014 Kenya Demographic and Health Survey to determine domestic violence and associated risk factors. I am trying to match the domestic violence numbers in table Tables 16.1.1 of the final report. However I keep getting a total of 4018 women instead of 5,657. Kindly assist. Below are the stata codes that I used. Thank you.
*OPEN FILE
use "G:\scientific writing\VIOLENCE\KE_2014_DHS_11142016_37_61056\keir70dt\KEIR 70FL.DTA ", clear
* GENERATING THE VARIABLE 'sexualviolence'
generate sexualviolence=.
replace sexualviolence = 0 if d105h == 0| d105h == 9 | d105i == 0| d105i == 9 ///
| d105k == 0 | d105k == 9
replace sexualviolence = 1 if d105h == 1 | d105i == 1 | d105k == 1
replace sexualviolence = 1 if d105h == 2 | d105i == 2 | d105k == 2
replace sexualviolence = 1 if d105h == 3 | d105i == 3 | d105k == 3
replace sexualviolence = 1 if d105h == 4 | d105i == 4 | d105k == 4
label variable sexualviolence "EVER EXPERIENCED SEXUAL VIOLENCE"
label define sexual_violence 0 "Never" 1 "Often" 2 "Sometimes" ///
3 "Yes, but not in the last 12 months" 4 "Yes, but frequency in last 12 months missing"
label value sexual_violence sexualviolence
tab sexualviolence [iweight=d005/1000000]
*GENERATE VARIABLE "physicalviolence"
generate physicalviolence=.
replace physicalviolence = 0 if d105a - d105f == 0 | d105j == 0
replace physicalviolence = 1 if d105a - d105f == 1 | d105j == 1
replace physicalviolence = 2 if d105a - d105f == 2 | d105j == 2
replace physicalviolence = 3 if d105a - d105f == 3 | d105j == 3
replace physicalviolence = 4 if d105a - d105f == 4 | d105j == 4
label variable physicalviolence "EVER EXPERIENCED PHYSICAL VIOLENCE"
label define physical_violence 0 "Never" 1 "Often" 2 "Sometimes" ///
3 "Yes, but not in the last 12 months" 4 "Yes, but frequency in last 12 months missing"
label value physical_violence physicalviolence
tab physicalviolence [iweight=d005/1000000]
Re: Matching the Kenya 2014 DHS domestic violence data [message #11445 is a reply to message #11175] Thu, 22 December 2016 00:59 Go to previous messageGo to next message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 803
Registered: January 2013
Senior Member
To match the number of women for the domestic violence module, use the following to initialize your sexualviolence or physicalviolence variables:
replace sexualviolence = 0 if v044==1

However, you have many other problems in your code:
1) You only ever assign values 0 or 1 to sexual violence, but you label values 2, 3, and 4 as well.
2) The label value statement should be as follows - you had the label and the variable names reversed:
label value sexualviolence sexual_violence 
3) When creating your physicalviolence variable, you write:
replace physicalviolence = 0 if d105a - d105f == 0 | d105j == 0
but this is subtracting d105f from d105a and testing the result against 0. You need to add in a loop through the variables to test d105a to d105f individually. I suggest using something like:
gen physicalviolence = .
foreach dvar of var d105a d105b d105c d105d d105e d105f d105j {
  replace physicalviolence = 0 if `dvar' == 0
}
4) You need to figure out the hierarchy order for each of the categories and test for them in the correct order.

Here is my best guess at the coding:
* GENERATING THE VARIABLE 'sexualviolence' 
gen sexualviolence = 0 if v044==1
foreach dval in 1 2 4 3 {
  foreach dvar of var d105h d105i d105k {
    replace sexualviolence = `dval' if sexualviolence == 0 & `dvar' == `dval'
  }
}
replace sexualviolence = 1 if sexualviolence == 0 & d130b == 1
replace sexualviolence = 3 if sexualviolence == 0 & d130b == 2
replace sexualviolence = 4 if sexualviolence == 0 & (d130b == 3 | d130b == 4)
replace sexualviolence = 2 if sexualviolence == 0 & d124 == 1 
replace sexualviolence = 3 if sexualviolence == 0 & d125 == 1

label variable sexualviolence "EVER EXPERIENCED SEXUAL VIOLENCE"
label define sexual_violence 0 "Never" 1 "Often" 2 "Sometimes" ///
  3 "Yes, but not in the last 12 months" 4 "Yes, but frequency in last 12 months missing" ///
  5 "Yes, but no information when"
label value sexualviolence sexual_violence
tab sexualviolence [iweight=d005/1000000] 

*GENERATE VARIABLE "physicalviolence"
gen physicalviolence = 0 if v044==1
foreach dval in 1 2 4 3 {
  foreach dvar of var d105a d105b d105c d105d d105e d105f d105j d117a {
    replace physicalviolence = `dval' if physicalviolence == 0 & `dvar' == `dval'
  }
}
replace physicalviolence = 1 if physicalviolence == 0 & d130a == 1
replace physicalviolence = 3 if physicalviolence == 0 & d130a == 2
replace physicalviolence = 4 if physicalviolence == 0 & (d130a == 3 | d130a == 4)
replace physicalviolence = 4 if physicalviolence == 0 & d115y == 0
replace physicalviolence = 5 if physicalviolence == 0 & d118y == 0

label define physical_violence 0 "Never" 1 "Often" 2 "Sometimes" ///
  3 "Yes, but not in the last 12 months" 4 "Yes, but frequency in last 12 months missing" ///
  5 "Yes, but no information when"
label value physicalviolence physical_violence
tab physicalviolence [iweight=d005/1000000]
Re: Matching the Kenya 2014 DHS domestic violence data [message #19141 is a reply to message #11445] Sun, 26 April 2020 12:11 Go to previous messageGo to next message
CarolineAkoth is currently offline  CarolineAkoth
Messages: 2
Registered: April 2020
Member
Hello,

I am using this same dataset but having a challenge in the final tally. The number of "Women selected and interviewed" is 5657. However upon extraction i note upto 1144 blanks rows in the dataset. Am i missing something?


I have attached the extracted dataset.

Thanks
  • Attachment: KDHS2014.xls
    (Size: 1.70MB, Downloaded 397 times)
Re: Matching the Kenya 2014 DHS domestic violence data [message #19142 is a reply to message #19141] Sun, 26 April 2020 15:00 Go to previous messageGo to next message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 803
Registered: January 2013
Senior Member
Yes, the questions you are looking at were only asked to women who were ever married. For never married women they are blank. See v502 for marital status.
Re: Matching the Kenya 2014 DHS domestic violence data [message #19144 is a reply to message #19142] Mon, 27 April 2020 05:42 Go to previous message
CarolineAkoth is currently offline  CarolineAkoth
Messages: 2
Registered: April 2020
Member
Thank you.
Previous Topic: Domestic violence
Next Topic: Physical violence
Goto Forum:
  


Current Time: Fri Nov 22 02:32:24 Coordinated Universal Time 2024