The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Reproductive Health » Contraceptive calendar - programme to decode vcal_1 and vcal_2?
Contraceptive calendar - programme to decode vcal_1 and vcal_2? [message #9184] Fri, 19 February 2016 12:29 Go to next message
fcavallaro is currently offline  fcavallaro
Messages: 17
Registered: October 2015
Location: London, UK
Member
Hello,

We are trying to work with the contraceptive calendar, and were wondering whether any forum members/DHS staff have any knowledge of programmes developed to decode vcal_1 and vcal_2 string variables into a more useful format? (e.g. into a long dataset where each record is one woman-month, with contraceptive use, pregnancy status and reason for discontinuation in separate variables)

Trevor-DHS, you mentioned you were working on a tutorial for using contraceptive calendar data back in June, could you please let us know if this is now available?
( http://userforum.dhsprogram.com/index.php?t=tree&goto=66 80&S=2a3641172fbda4f95622f6b020b341d1&srch=contracep tive+calendar#msg_6680)
Would the DHS consider developing a programme to make the contraceptive calendar more user-friendly (similar to the unmet need Stata do-files)?

Many thanks,
Francesca

(Epidemiologist, LSHTM)
Re: Contraceptive calendar - programme to decode vcal_1 and vcal_2? [message #9231 is a reply to message #9184] Thu, 25 February 2016 17:19 Go to previous messageGo to next message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
Dear User,
We have your request in the queue and will respond as soon as we can. Thank you!
Re: Contraceptive calendar - programme to decode vcal_1 and vcal_2? [message #9238 is a reply to message #9231] Thu, 25 February 2016 22:57 Go to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 805
Registered: January 2013
Senior Member
There is no one way or one most useful format for the calendar data. For some things the current format is the most useful, but for others a long format is more useful. And because there are many different analyses that can be performed with the calendar data we do not expect to have a single set of code for the calendar similar to the unmet need code.

We are still working on a tutorial for using the contraceptive calendar which will give more details of different ways to analyze the calendar, but in the meantime, here is some simple code for converting the calendar into long format:

forvalues i = 1/80 {
  gen vcal1_`i' = substr(vcal_1,`i',1)
  gen vcal2_`i' = substr(vcal_2,`i',1)
}
keep caseid v001 v002 v003 v005 v008 v011 v017 v018 v019 vcal1* vcal2*
reshape long vcal1_ vcal2_, i(caseid) j(i)
gen cmc=v017+80-i
gen age=int((cmc-v011)/12)


Also, please see the user forum post about alignment issues in the calendar. Some recode datasets have the calendar misaligned. Using the code in the post mentioned, you can realign the calendar when necessary. Do the realignment before running the code above.
Previous Topic: Re: Peru individual survey documentation + calendar
Next Topic: Peru individual survey documentation + calendar
Goto Forum:
  


Current Time: Sat Dec 28 03:07:01 Coordinated Universal Time 2024