Hi
I am trying to add a variable to the below data by coding 1 if it includes "7011" between variables code1 and code8. It is coded 0 if it does not include "7011" or missing. Do you know any relevant Stata command for this? I thought the egen command with an if statement.

I am trying to add a variable to the below data by coding 1 if it includes "7011" between variables code1 and code8. It is coded 0 if it does not include "7011" or missing. Do you know any relevant Stata command for this? I thought the egen command with an if statement.

Comment