I have a panel data and my time variable is defined as "YYYYMM". I need to create a dummy variable for month, however I am not quite sure if its the best solution to define the data set as time series. I was traying with the following command:
date_january <- ifelse((DATA$date == 202001),1,0)
However it is not really optimal due I have monthly data since 2010. Can anyone asist me?
Many thanks
Miguel