Hi all,

I read the syntax of regress and operators but still cannot find how to run a regression with a condition that: variable "INDC3" not equal to 'NA', 'UNCLS', 'UQEQS')
My original code below works well
Code:
areg wINV_DAY pt wFIRM_SIZE LNGDP UNEMPLOYMENT  INFLATION wTANGIBILITY  i.yr , a(TYPE2)
My code below caused error:
Code:
areg wINV_DAY pt wFIRM_SIZE LNGDP UNEMPLOYMENT  INFLATION wTANGIBILITY  i.yr if (INDC3 ~=('NA', 'UNCLS', 'UQEQS')) , a(TYPE2)
The error is:
Code:
'NA','UNCLS','UQEQS' invalid name
r(198);
When I changed from "~=" TO "!=" , the same error popping up.
Can you please help me to adjust the code to run the regression where INDC3 not equal to "NA", "UNCLS" or "UQEQS"?


Update:
I changed from single quotation to double quotation (
HTML Code:
if (INDC3 ~=("NA", "UNCLS", "UQEQS"))
)and it works, but I am not sure whether it is a proper fix?