![Statalist](/includes/images/head_statalist.jpg) |
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Using Mata within a foreach loop = r(1)
Dear all,
When I try to do stuff in Mata within a loop, in a do file, I receive
the following error message:
--Break--
r(1);
end of do-file
--Break--
r(1);
I looked up r(1), and it says:
[P] error . . . . . . . . . . . . . . . . . . . . . . . . . Return
code 1
You pressed Break. This is not considered an error.
(Of course, I don't press break while the loop is executing.)
The following very simple loop reproduces the error I get
foreach i in 1 2 {
mata:
A=1,2
A
mata clear
end
}
Any clue about what my mistake is?
All best,
Pablo Mitnik
--
Pablo A. Mitnik
University of Wisconsin-Madison (http://www.wisc.edu/ )
Department of Sociology ( http://www.ssc.wisc.edu/soc/)
Center on Wisconsin Strategy (http://www.cows.org/ )
1180 Observatory Drive
Room 7114A
Madison, WI 53706
TEL (608) 2621839
E-mail: [email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/