creating weekly and semi annual dummies with @expand

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

ray2013
Posts: 18
Joined: Thu Oct 24, 2013 12:41 pm

creating weekly and semi annual dummies with @expand

Postby ray2013 » Thu Oct 24, 2013 1:50 pm

i know @expand(@month) creates 12 dummies for a year
how do i create weekly dummies (ie 52 dummies) for a year and semiannual dummies (2 dummies) for a year with @expand command.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: creating weekly and semi annual dummies with @expand

Postby EViews Gareth » Thu Oct 24, 2013 1:58 pm

What structure/frequency is your workfile?

ray2013
Posts: 18
Joined: Thu Oct 24, 2013 12:41 pm

Re: creating weekly and semi annual dummies with @expand

Postby ray2013 » Thu Oct 24, 2013 2:06 pm

1900s01
1900s02
1901s01
1901s02
1902s01
1902s02
basically my sample is 1900s1 1905s2


and also 1900w01
1900w02

my sample for this series is 1900w01 1901w52

and i want to create dummies using @expand for both cases

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: creating weekly and semi annual dummies with @expand

Postby EViews Gareth » Thu Oct 24, 2013 4:13 pm

@expand(@datepart(@date, "ww"))
@expand(@datepart(@date, "s"))

ray2013
Posts: 18
Joined: Thu Oct 24, 2013 12:41 pm

Re: creating weekly and semi annual dummies with @expand

Postby ray2013 » Thu Oct 24, 2013 6:24 pm

thanks very much.

i also tried using "for next" looping with "seas" command to see if i can create dummies also for the weekly series and i was getting this error message "flow of control statement executed from command line"
can i get some corrections in the code i wrote

1900w1
1900w2 to
1900w52


this is code i wrote expecting it to create 52 dummies

for !k = 1 to 52
genr weekdummy(!k)= seas(!k)

next

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: creating weekly and semi annual dummies with @expand

Postby EViews Gareth » Thu Oct 24, 2013 6:57 pm

For loops can only be used in a program.

ray2013
Posts: 18
Joined: Thu Oct 24, 2013 12:41 pm

Re: creating weekly and semi annual dummies with @expand

Postby ray2013 » Fri Oct 25, 2013 2:12 pm

i want to fill out of sample data in my forecast series and standard error series with "na" when i use the forecast command
my data is from 1905m1
1905m2
to 1910m12

i want to forecast yhat and yhatse series values for 1906m1 1908m12 using the forecast command so that observations before and after these dates are filled with "na"
i tried
linermodel.forecast(f="na") yhat yhatse

it only worked on yhatse and filled out of sample series with "na"
but it didnt work on yhat series.

how do i fill both out of sample series for both yhat and yhatse with "na" using the forecast command.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: creating weekly and semi annual dummies with @expand

Postby EViews Gareth » Fri Oct 25, 2013 3:04 pm

The option is f=na, not f="na"

ray2013
Posts: 18
Joined: Thu Oct 24, 2013 12:41 pm

Re: creating weekly and semi annual dummies with @expand

Postby ray2013 » Mon Oct 28, 2013 4:47 am

my GDP data is from 1901m1 to 1910m12
is there a way to generate GDP data from the range say from 1905m1 to 1907m12 without coping it physically from the GDP series

i tried
smpl 1905m1 1907m12
stom(GDP,newGDP)
But it creates it has a vector.

is that a way to create it as a series so i used it to draw my graph and use it in my equation

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: creating weekly and semi annual dummies with @expand

Postby EViews Gareth » Mon Oct 28, 2013 8:05 am

I'm afraid I do not understand what you are asking.

ray2013
Posts: 18
Joined: Thu Oct 24, 2013 12:41 pm

Re: creating weekly and semi annual dummies with @expand

Postby ray2013 » Mon Oct 28, 2013 8:30 am

i have this
obs GDP
1900M1 12
1900M2 15
1900M3 5
. .
. .
1990m12 29

i want to generate a new column called newGDP with GDP figures from say 1920m1 to 1925m12 with a command to get something like this
obs GDP
1920M1 7
1920M2 10
.
.
1925M12 8


I tried this and it gives me newGDP as a vector.

smpl 1920m1 1925m12
stom(GDP,newGDP)

I need newGDP as a series not as a vector without "na" appearing in the out of sample data.

is there a better way to do this

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: creating weekly and semi annual dummies with @expand

Postby EViews Gareth » Mon Oct 28, 2013 8:53 am

Still not particularly clear, I'm afraid.

I think you want to create a new series called NewGDP. What I don't know is where the data for that series is going to come from.

ray2013
Posts: 18
Joined: Thu Oct 24, 2013 12:41 pm

Re: creating weekly and semi annual dummies with @expand

Postby ray2013 » Mon Oct 28, 2013 12:54 pm

let see if i can explain it better

my range is 1952q1 1996q4 180 obs
sample is 1953q1 1954q4 8 obs

each quarter has GDP Value in a series called GDP

My question is how can i pull out the GDP VAlues from my sample 1953q1 1954q4 with an eview command from my range to analyse and name the new series as newGDP without physically copying and pasting it in an empty group myself .

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: creating weekly and semi annual dummies with @expand

Postby EViews Gareth » Mon Oct 28, 2013 1:20 pm

Code: Select all

series newgdp = gdp
?

startz
Non-normality and collinearity are NOT problems!
Posts: 3798
Joined: Wed Sep 17, 2008 2:25 pm

Re: creating weekly and semi annual dummies with @expand

Postby startz » Mon Oct 28, 2013 2:16 pm

Code: Select all

series newgdp = gdp
?
Or to expand on Gareth's suggestion

Code: Select all

smpl 1953q1 1954q4 series newgdp = gdp


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests