The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Reproductive Health » Reproductive calendar
Re: Reproductive calendar [message #1390 is a reply to message #1388] Thu, 20 February 2014 15:09 Go to previous messageGo to previous message
user-rhs is currently offline  user-rhs
Messages: 132
Registered: December 2013
Senior Member
Kash,
From a USAID 2009 report: Levels, Trends, and Reasons for Contraceptive Discontinuation (http://pdf.usaid.gov/pdf_docs/PNADQ639.pdf)

Quote:
The DHS has created a system for generating events-based datasets from the calendar data,
where each change in the calendar becomes one observation, or ―row,‖ in a dataset. Each event
in the calendar--an episode of contraceptive use, a pregnancy, a birth, a termination, or an
episode of contraceptive non-use--is converted from the calendar string (the VCAL variables in
individual recode or woman-based datasets) into a separate observation for analysis. The start
and end date of each event is also recoded, allowing us to calculate directly the duration of the
event, women's age, women's parity, and children ever born (using the birth history) at the start
or end of each event.



As an alternative, you may want to read documentation on the string or substr function in Stata. Someone may have already answered your question on Statalist http://www.stata.com/statalist/archive/


RHS


EDIT: I have attached a do-file that does what was mentioned in the report (takes the string and creates a new observation for each character). For this country, the length of the VCAL_1 variable was 65, so I generated 65 new vbls and reshaped from wide to long. From here, you can use -stset- or what have you to set the dataset as survival time data, panel, etc. I used Excel to help me repeat all of those command lines 65 times. I'm sure there's a more elegant way to do this, but this is one way you can get started
  • Attachment: vcal.do
    (Size: 2.27KB, Downloaded 1143 times)
  • Attachment: vcal.xlsx
    (Size: 10.67KB, Downloaded 1133 times)

[Updated on: Thu, 20 February 2014 18:10]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Variable labels for reproductive calendar - Nigeria 2013
Next Topic: Knowledge of contraceptive methods - Senegal v304
Goto Forum:
  


Current Time: Sat Dec 28 17:44:27 Coordinated Universal Time 2024