I am trying to execute the same commands for two different files using foreach. The problem is that I only want to run melogit for one file. I receive an error when I include an if-statement in melogit. Below is an example:
Is this possible?
Code:
foreach file in file1 file2 {
use `file', clear
*********************************************
**some code, including other models
*********************************************
*I only want to run this model on file1
melogit dv v1 v2* if `file' = file1 || re1: || re2:
}

Comment