09-11-2014 05:05 PM
Hi, I have a panel data set with stock ID, month and returns. I would like to generate a time dummy variable that if first month, then q1=1 and other months 0. Is there a quick way to do this? Thanks.
09-11-2014 05:45 PM
thanks for the prompt help. I ran the above code, but cannot get what I want. I got q1=1 for all observations. Also, I need to generate many time dummies instead of only one. I have 200 months. Therefore I need 200 dummies, q1 to q200.
09-11-2014 05:57 PM
No, I don't want to set the first quarter for each stock_id to 1. I have a variable month, which ranges from 1 to 200. I want to create 200 new variables q1 - q200, with q1 = 1 with all observations that have month=1 and 0 otherwise, q200 =1 with all observations that have month=200 and 0 otherwise.