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