How to create month dummy variable automatically?
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
How to create month dummy variable automatically?
I have a variable with name which includes year, month, day, but these three (year, month, day) are just one category. In that case, how to create month dummy variable automatically? What more, my variable takes the values of 2013-01-13, 2014-01-13, and so on. Hence, I am only interested month dummy variable.
Last edited by gansuld on Thu Jun 26, 2014 6:46 pm, edited 1 time in total.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
Re: How to create month dummy variable automatically?
Is your work file structured by that variable?
Re: How to create month dummy variable automatically?
My data is pooled cross section. I mean, my data is by month in 2013, 2014. I have entered the data in Eviews as unstructured working file.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
Re: How to create month dummy variable automatically?
Post the workfike
Re: How to create month dummy variable automatically?
It is my working file.
- Attachments
-
- 00_my data.wf1
- (552.14 KiB) Downloaded 403 times
Re: How to create month dummy variable automatically?
I have 17 months. I want to create month dummy variables automatically using date?
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3796
- Joined: Wed Sep 17, 2008 2:25 pm
Re: How to create month dummy variable automatically?
Code: Select all
series month=@datepart(date,"mm")
series d1=month=1Re: How to create month dummy variable automatically?
Thank you very much. I used this command. However, I have one problem. I created the variable is d1, but for the d1, "2013-01" and "2014-01" are the same values. In my case, 2013-01 and 2014-01 are different values. I mean 2014-01 should equal to 13, 2014-02 should equal to 14, and so on. Help me...
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3796
- Joined: Wed Sep 17, 2008 2:25 pm
Re: How to create month dummy variable automatically?
Something like
Code: Select all
series month=@datepart(date,"mm")
series year=@datepart(date,"yyyy")
series distinctMonth = month+ year-2013
series d1=distinctMonth =1Re: How to create month dummy variable automatically?
Thanks a million!!! Again, I have one question. How to change a value of variable in eviews automatically?
Who is online
Users browsing this forum: No registered users and 2 guests
