Hi, I have observations with a start date and an end date (e.g. 04/31/1997 and 02/19/2002) and I want to create a dummy variable for each year (and fraction thereof) between each observations start and end date. In practice, I also want the year to begin on April 1st rather than Jan 1st.
For example, converting the above dates into dummy variables indicated with ‘1’ for 1997,1998,1999,2000,2001 and ‘0’ for other years in the dataset - note that 2002 isn't include because it doesn't include my start of the year = April 1st). Does that makes sense? Any ideas on how I could code this/
Cheers
Related Posts with Converting a start and end date (a timeframe) into several annual time dummies
question to stset _t and _t0Hi guys, I am new to Stata, just wondering how stata calculates the value of _t and _t0. Many thx …
Code blocks on this forum need fixingThe code blocks on this forum give weird output every now and then. Specifically, multi-line code is…
Help with -foreach loop commandHi, I am trying to simplify my code to generate and replace multiple variables. Below is the code t…
Trust game and a new method to measure reciprocityI am working in with a Trust Game Experiment and someone suggest me that I can use an alternative me…
Change over timeHi all, I have a data-set of organizations and their service sites for 2014-2018. Organizations 1) o…
Subscribe to:
Post Comments (Atom)
0 Response to Converting a start and end date (a timeframe) into several annual time dummies
Post a Comment