Problem with FOR statement

For questions regarding programming in the EViews programming language.

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

ricbeb
Posts: 4
Joined: Fri Jul 02, 2021 9:31 am

Problem with FOR statement

Postby ricbeb » Tue Aug 31, 2021 4:57 am

Hi! I'm using the FOR statement in my program, and got this error message:

For statement unterminated in "FOR !Z=1 TO 2"

Just to give some background, this is the relevant part of the code, where I'm defining two different samples to run the regressions:

sample muestra_est1 2001Q1 2020Q4
sample muestra_est2 2001Q1 2014Q4

for !z=1 to 2 [NOTE: THIS IS WHERE I GET THE ERROR MESSAGE AND THE PROGRAM STOPS]
smpl muestra_est{!z}

Any suggestions?

Many thanks for your time and kindness!

Ricardo

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

Re: Problem with FOR statement

Postby startz » Tue Aug 31, 2021 6:31 am

Do you have a matching

Code: Select all

NEXT
statement?

csullivanj
Posts: 2
Joined: Mon Aug 30, 2021 12:50 am

Re: Problem with FOR statement

Postby csullivanj » Sun Sep 12, 2021 8:39 pm

Hi all, i have a similar problem

I have two variables, a continuous variable, and ages.

I want to compute descriptive statistics for a variety of custom age ranges that are not currently programmed.

I am trying to use

[series a =@recode(AGE<44,1,na)]

And then repeat for the age ranges, then use this as a specification when computing "stats by classification" but it does not work. Can anyone assist here?

EViews Matt
EViews Developer
Posts: 505
Joined: Thu Apr 25, 2013 7:48 pm

Re: Problem with FOR statement

Postby EViews Matt » Tue Sep 14, 2021 7:17 am

Hello,

I'm afraid we're going to need more information. The single code line you've shared would seem fine for creating a 1/na dummy series based on the contents of the AGES series. What other code isn't working?


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 8 guests