Hi all:
I am trying to generate a set of quarterly dummy variables for a range of dates but can't seem to figure out how to do it. I have the date variable formatted as %tq in one column. I tried tabulate with gen but that didn't work because the 1s did not correspond to the correct year and quarter. I am assuming that using the min(date) as the beg date and incrementing it by _n+1 quarter until the max(date) in the variable would be the way to go but can't figure it out how to do it. I would appreciate is someone can show me the correct procedure to generate the dummies. Thanks.
I am trying to generate a set of quarterly dummy variables for a range of dates but can't seem to figure out how to do it. I have the date variable formatted as %tq in one column. I tried tabulate with gen but that didn't work because the 1s did not correspond to the correct year and quarter. I am assuming that using the min(date) as the beg date and incrementing it by _n+1 quarter until the max(date) in the variable would be the way to go but can't figure it out how to do it. I would appreciate is someone can show me the correct procedure to generate the dummies. Thanks.
Comment