Hi everybody,
i'm using eviews 7 and have a problem with the following.
I need to create an alpha object land_abk that contains the values A, B, ..., J. One alpha object land_name that contains the values "Republik A", "Republik B", ... , "Republik J". And one series object d_member containing the value 0 for the first 5 observations and 1 for the last 5 observations.
I got the right answer, but I'm not sure if I really understand what I am doing there.
pagecreate(page=land) u 10
alpha land_abk
alpha land_name
series d_member=0
d_member.setformat f.0
!i = 1
for %ctr A B C D E F G H I J
smpl !i !i
land_abk = %ctr
land_name = "Republik "+%ctr
if !i > 5 then
d_member = 1
endif
!i =!i + 1
next
sample@all
I have difficulties with the FOR loop. Generally I understand what to do, but what does that "smpl !i !i" (= smpl 1 1?) and that "!i = !i+1" mean?
thanks for your help!
loop problem
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13583
- Joined: Tue Sep 16, 2008 5:38 pm
Re: loop problem
Code: Select all
smpl 1 1
The next time through the loop it switches to the second observation. And so on...
Who is online
Users browsing this forum: No registered users and 2 guests
