Creating New Series using conditional
Posted: Wed Jun 21, 2017 11:09 am
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!
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!