Page 1 of 3

creating weekly and semi annual dummies with @expand

Posted: Thu Oct 24, 2013 1:50 pm
by ray2013
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.

Re: creating weekly and semi annual dummies with @expand

Posted: Thu Oct 24, 2013 1:58 pm
by EViews Gareth
What structure/frequency is your workfile?

Re: creating weekly and semi annual dummies with @expand

Posted: Thu Oct 24, 2013 2:06 pm
by ray2013
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

Re: creating weekly and semi annual dummies with @expand

Posted: Thu Oct 24, 2013 4:13 pm
by EViews Gareth
@expand(@datepart(@date, "ww"))
@expand(@datepart(@date, "s"))

Re: creating weekly and semi annual dummies with @expand

Posted: Thu Oct 24, 2013 6:24 pm
by ray2013
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

Re: creating weekly and semi annual dummies with @expand

Posted: Thu Oct 24, 2013 6:57 pm
by EViews Gareth
For loops can only be used in a program.

Re: creating weekly and semi annual dummies with @expand

Posted: Fri Oct 25, 2013 2:12 pm
by ray2013
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.

Re: creating weekly and semi annual dummies with @expand

Posted: Fri Oct 25, 2013 3:04 pm
by EViews Gareth
The option is f=na, not f="na"

Re: creating weekly and semi annual dummies with @expand

Posted: Mon Oct 28, 2013 4:47 am
by ray2013
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

Re: creating weekly and semi annual dummies with @expand

Posted: Mon Oct 28, 2013 8:05 am
by EViews Gareth
I'm afraid I do not understand what you are asking.

Re: creating weekly and semi annual dummies with @expand

Posted: Mon Oct 28, 2013 8:30 am
by ray2013
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

Re: creating weekly and semi annual dummies with @expand

Posted: Mon Oct 28, 2013 8:53 am
by EViews Gareth
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.

Re: creating weekly and semi annual dummies with @expand

Posted: Mon Oct 28, 2013 12:54 pm
by ray2013
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 .

Re: creating weekly and semi annual dummies with @expand

Posted: Mon Oct 28, 2013 1:20 pm
by EViews Gareth

Code: Select all

series newgdp = gdp
?

Re: creating weekly and semi annual dummies with @expand

Posted: Mon Oct 28, 2013 2:16 pm
by startz

Code: Select all

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

Code: Select all

smpl 1953q1 1954q4 series newgdp = gdp