Hello, I need to complete a practise research based on a selected theory in social sciences. My theory involves a multi-group confirmatory factor analysis in STATA and Mplus, in which I compare rural and urban respondents based on variables such as employment, education etc. But I'm not sure if I understand correctly the general flow of the research: 1. theory construction, 2. variable selection and testing, 3. exploratory factor analysis to reduce the number of variables, and 4. confirmatory factor analysis. Is this method fitting to my objective?
I also have a specific STATA-related question: I need to split the variable into two, and it is a survey variable (e.g. people living in: town:_, city:_, village:_). Which command do I need to use?

Thanks in advance for the help.