Hello,
I have a duration data where I observe the date an ad was started (first_date) and the date it was removed (end_date). My dataset covers the period between January 2017 and Apr 2022. I would like to create a separate dummy variable for each month (in total 64 dummy variables for 64 months). Initially all dummy variables should equal 0. Then, I'd like to change the values of these dummies from 0 to 1 if the ad was live on that month. That is, if an add's first_date is 23mar2017 and last date is 18feb2018, then I would like to change the values of dummy variables from March 2017 to Feb 2018 to 1 for this observation. Can you help me doing this? Thank you very much in advance for your attention!
I have a duration data where I observe the date an ad was started (first_date) and the date it was removed (end_date). My dataset covers the period between January 2017 and Apr 2022. I would like to create a separate dummy variable for each month (in total 64 dummy variables for 64 months). Initially all dummy variables should equal 0. Then, I'd like to change the values of these dummies from 0 to 1 if the ad was live on that month. That is, if an add's first_date is 23mar2017 and last date is 18feb2018, then I would like to change the values of dummy variables from March 2017 to Feb 2018 to 1 for this observation. Can you help me doing this? Thank you very much in advance for your attention!
Comment