As we know, we can run a Stata command in Mata as below:
In my problem, I have to use a Stata command in Mata's for loop, however, I realized that a command like the above does not work:
Specifically, it returns an error message "invalid expression".
So, my question is that is there a way to run a Stata command in the loop?
Code:
mata: mata stata display "Hi!" end
Code:
mata: for (i = 1; i <= 10; i++) { mata stata display "Hi!" } end
So, my question is that is there a way to run a Stata command in the loop?
Comment