Page 1 of 1

Delete estimated equation

Posted: Fri Mar 17, 2017 2:13 am
by stefanp
I intend to delete an estimated equation depending on some criteria. In fact, there is a series "value" that equals 2 for each obsid in each cross section, except for one obsid. For each cross section, there is exactly one obsid at which value<1 holds. Furthermore, I have estimated equations with different periods for each cross sections.

Suppose there are the following estimated equations:
aa_1
aa_2
aa_3
bb_1
bb_2
bb_3
where aa and bb are cross sections and 1 and 2 indicate the different estimation periods. Suppose the series "value" equals 0.5 for aa_2 and 0.6 for bb_1 (else 2). I would like to run a loop that deletes all equations unless "value"<1, i.e. keep aa_2 and bb_1 only.

Code: Select all

for !i=1 to 3 string q=@str(!i) for %jj aa bb smpl @first+!i-1 @first+!i-1 if ident=%jj if value>1 then delete {%jj}_{q} endif next next
However, it does not work. Any suggestions?

Re: Delete estimated equation

Posted: Fri Mar 17, 2017 8:32 am
by EViews Gareth
if statements have to evaluate to a single scalar value. Thus you can't use them on an series. Try using:

Code: Select all

if @max(value)>1 then