I am trying to create a dummy variable for some countries that are federal states using the following code:
Code:
replace federal_states = 1 if iso_code == inlist(iso_code, "ARG", "AUS", "AUT", "BEL", "BRA", "CAN", "DEU", "IND") | inlist(iso_code, "RUS", "ZAF", "ESP", "CHE", "USA", "MEX" )
type mismatch
Does anyone know how to include a list of values when we use if condition with replace? I also tried to look in previous posts in the forum but I could not find much.
Best regards
Alessio Lombini
0 Response to Replace with long list of values
Post a Comment