Page 1 of 1
How to create month dummy variable automatically?
Posted: Thu Jun 26, 2014 6:34 pm
by gansuld
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.
Re: How to create month dummy variable automatically?
Posted: Thu Jun 26, 2014 6:44 pm
by EViews Gareth
Is your work file structured by that variable?
Re: How to create month dummy variable automatically?
Posted: Thu Jun 26, 2014 6:58 pm
by gansuld
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.
Re: How to create month dummy variable automatically?
Posted: Thu Jun 26, 2014 7:49 pm
by EViews Gareth
Post the workfike
Re: How to create month dummy variable automatically?
Posted: Thu Jun 26, 2014 7:57 pm
by gansuld
It is my working file.
Re: How to create month dummy variable automatically?
Posted: Thu Jun 26, 2014 8:00 pm
by gansuld
I have 17 months. I want to create month dummy variables automatically using date?
Re: How to create month dummy variable automatically?
Posted: Thu Jun 26, 2014 8:22 pm
by startz
Code: Select all
series month=@datepart(date,"mm")
series d1=month=1
Re: How to create month dummy variable automatically?
Posted: Thu Jun 26, 2014 9:17 pm
by gansuld
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...
Re: How to create month dummy variable automatically?
Posted: Fri Jun 27, 2014 5:11 am
by startz
Something like
Code: Select all
series month=@datepart(date,"mm")
series year=@datepart(date,"yyyy")
series distinctMonth = month+ year-2013
series d1=distinctMonth =1
Re: How to create month dummy variable automatically?
Posted: Sun Jun 29, 2014 7:13 pm
by gansuld
Thanks a million!!! Again, I have one question. How to change a value of variable in eviews automatically?