How to create a dummy variable that has a specific duration
Posted: Sun Sep 07, 2014 1:34 am
Hello,
I need help for creating couple of dummy variables for my study. The data I am using is for the period 2003-2012. The variables are the following:
1. Autumn dummy variable which has the duration 22.09-21.12, where the variable equals to 1 for the days during the fall and o otherwise. I start doing it the following way: series autumn= @recode(@date>=22.09.2003, 1,0)+ @recode (@date<=21.12.2012,1,0) , but it doesn't work, cause it simply gives equals to 1 for all dates. I quess it is beacause of the date period I typed or could be the whole equation. I am quite new in this area and I need a bit help to get more familiar with the program.
2.A dummy variable that covers the period 26.12- 7.1 annually.
3. Weather variables
I will appreciate it if you help me with it or at least give me some orientation for it. Thank you!
I need help for creating couple of dummy variables for my study. The data I am using is for the period 2003-2012. The variables are the following:
1. Autumn dummy variable which has the duration 22.09-21.12, where the variable equals to 1 for the days during the fall and o otherwise. I start doing it the following way: series autumn= @recode(@date>=22.09.2003, 1,0)+ @recode (@date<=21.12.2012,1,0) , but it doesn't work, cause it simply gives equals to 1 for all dates. I quess it is beacause of the date period I typed or could be the whole equation. I am quite new in this area and I need a bit help to get more familiar with the program.
2.A dummy variable that covers the period 26.12- 7.1 annually.
3. Weather variables
I will appreciate it if you help me with it or at least give me some orientation for it. Thank you!