Hello, I am looking for some help trying to match text between variables in the same row. Essentially, I am looking to see if a text string in one variable matches a string in several other variables. An example of my data is shown below. I want to see if the string in Var1 matches any of the strings in iVar1, iVar2, iVar3 with a flag variable by row. Is there a way to do this? It seems like it should be easy but I can't figure it out. Any help would be much appreciated, thank you for your time!
ID Var1 Var2 Var3 iVar1 iVar2 iVar3 var1_flag
1 Charlie Bravo Alpha Bravo Alpha Charlie Y
2 Alpha Charlie Alpha Charlie Y
3 Bravo Charlie N
4 Charlie Bravo Bravo Alpha Charlie Y
5 Alpha N