%IF Statement

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
BobR
Posts: 5
Joined: Tue May 20, 2014 10:06 am

%IF Statement

Unread post by BobR »

I am using the %IF statements

set qdlfm = %if(t==1,lf,lf-(1-(7/337))*lf{1})
set qdintm = %if(t==1,1,1-(7/337))

which are intended to create, in the first statement, the series qdlfm with value of series lf at observation 1 and lf-(1-(7/337))*lf{1}) at all other observations. The second statement attempts to create a series qdintm with the value 1 at observation 1 and then 1-(7/337) at the other observations. What I get from these is the first difference of lf from the first statement and unity at all observations from the second statement. Can someone suggest how to correct these to produce the intended series? Thanks.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: %IF Statement

Unread post by TomDoan »

7.0/337.0 not 7/337. The second is an integer divide.
Post Reply