Hi there,
I would like to create a new series from an existing one called "airtemp". Im trying to get a (airtemp-24)^2 result when the value in "airtemp" exceeds 24; a (16-airtemp)^2 result when the value in "airtemp" is below 16 and "0" otherwise. But the following command is giving me back "Sytax error". Is there anyone that could spot the mistake?
smpl @all
alpha decision=0
smpl if airtemp>24
decision = (airtemp-24)^2
smpl if airtemp<16
decision = (16-airtemp)^2
smpl @all
Thanks so much in advance!
Creating New Series using conditional
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13305
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Creating New Series using conditional
You're declaring it as an alpha (which contains strings) and setting it equal to a number.
Either use series instead of alpha, or change the values to be strings (with the @str function).
Either use series instead of alpha, or change the values to be strings (with the @str function).
Follow us on Twitter @IHSEViews
Re: Creating New Series using conditional
EViews Gareth wrote:You're declaring it as an alpha (which contains strings) and setting it equal to a number.
Either use series instead of alpha, or change the values to be strings (with the @str function).
Hi Gareth,
All done thanks!
Who is online
Users browsing this forum: No registered users and 19 guests