The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » India » pre and post Covid-19 groups India
Re: pre and post Covid-19 groups India [message #28323 is a reply to message #28315] Thu, 14 December 2023 07:27 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3199
Registered: February 2013
Senior Member
Following is a response from Senior DHS staff member, Tom Pullum:


The Stata lines pasted below will give a variable that is 1 for interview dates on or after March 25, 2020, and 0 for earlier dates. If you want to run this in the IR or KR file, just replace "hv" with "v'.

use "...IAPR7EFL.DTA", clear

gen days_out=mdy(hv006,hv016,hv007)-mdy(3,25,2020)
gen     after=0
replace after=1 if days_out>=0
label define after 0 "" 1 ""
label values after after

tab after
 

Using the "mdy" command will give what you want.

[Updated on: Thu, 14 December 2023 07:35]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Variables on caste and wealth
Next Topic: NFHS-5 District vis a vis 2011 census
Goto Forum:
  


Current Time: Wed Nov 27 18:56:31 Coordinated Universal Time 2024