Page 1 of 1

repeat alpha series

Posted: Wed May 03, 2017 8:25 am
by metrix
hi
i have two workfile:
workfile 1 with: page one by frequency month 12 years, second page unstructured 30 obs
i have use alpha month=" January February....December" to make reapeat with monthly, but no! all value month(1)= January February....December.
same with my unstructured page 10 alpha, alpha name="california Florida New York Wisconsin Delaware Kansas Illinois North Dakota South Dakota Texas"
i would like reapt alpha series like this:
January
February
March
....
January
.....

for undated seris:
california
...
Texas
california
...
second workfile 2 panel(monthly): i have crossid from 1 to 7 "inf, gdp, irate, exchange, M1, usd, euro"
how can change 1 by "inf", 2 by "gdp" ...., i can create a new Alpha series to create idenification with the names this manually take long time and fill them too.
could help me to solve this

Re: repeat alpha series

Posted: Wed May 03, 2017 8:42 am
by startz
something like

Code: Select all

smpl 13 @last y = y(-12) smpl @all

Re: repeat alpha series

Posted: Wed May 03, 2017 8:43 am
by EViews Gareth
Problem 1:
(Note the first page could be done using date functions much more simply, but since you want to do the second page too, I'll show you the general solution)

Code: Select all

%list = "January February March April May June July August September October November December" !num = @wcount(%list) for !i = 1 to !num smpl if @mod(@trend,!num)=!i-1 alpha mymonths = @word(%list,!i) next

Problem 2:
You'll have to describe it more clearly.

Re: repeat alpha series

Posted: Wed May 03, 2017 9:09 am
by metrix
I forgot to thank you Mr Gareth and Mr starz :oops: sorry.
1/ how can do this by function in monthly could you show me please. ( i have puting "_" for the unstructured page).
2/ i have 7 crossid. i would like to change 1 by inf
1 - 80m01 would be inf -80m01
1- 80m02 would be inf -80m02
.....
2 - 80m01 would be 1 -80m01
2- 80m02 would be 1 -80m02

Re: repeat alpha series

Posted: Wed May 03, 2017 9:19 am
by EViews Gareth
1) Use the @datestr function

2) Same idea:

Code: Select all

%list = "inf gdp foo goo hoo boo doo" for !i=1 to 7 smpl if @crossid=!i alpha myalpha = @word(%list,!i) next

Re: repeat alpha series

Posted: Wed May 03, 2017 9:25 am
by metrix
i get error message Error in Sample: DATESTR is not defined in "SMPL IF DATESTR=1-1".
%list = "January February March April May June July August September October November December"
!num = @wcount(%list)
for !i = 1 to !num
smpl if datestr=!i-1
alpha mymonths = @word(%list,!i)
next

Re: repeat alpha series

Posted: Wed May 03, 2017 9:26 am
by startz
@ sign

Re: repeat alpha series

Posted: Wed May 03, 2017 9:28 am
by metrix
error messge Error in Sample: Incorrect number of arguments for @DATESTR function in "SMPL IF @DATESTR=1-1".

Re: repeat alpha series

Posted: Wed May 03, 2017 9:35 am
by startz
You need to give arguments to the @datestr function. Take a look in the Help system.

Re: repeat alpha series

Posted: Wed May 03, 2017 9:44 am
by metrix
@datestr(x,"m") Than what I put in the place x

Re: repeat alpha series

Posted: Wed May 03, 2017 9:44 am
by EViews Gareth
@date

Re: repeat alpha series

Posted: Wed May 03, 2017 9:48 am
by metrix
Error in Sample: Numeric operator applied to string data in"SMPL IF @DATESTR(@DATE,"M")=1-1".
%list = "January February March April May June July August September October November December"
!num = @wcount(%list)
for !i = 1 to !num
smpl if @datestr(@date,"m")=!i-1
alpha mymonths = @word(%list,!i)
next

Re: repeat alpha series

Posted: Wed May 03, 2017 10:03 am
by EViews Gareth
show @DATESTR(@DATE,"M")

Re: repeat alpha series

Posted: Wed May 03, 2017 10:11 am
by metrix
I thought it was by loop, sorry for the inconvenience.
thanks you Mr Gareth and Mr startz.