I am studying from the STATA guide.
I typed MATA and then copied and entered the following command as shown in the entry for STATA:
: real matrix id(real scalar n)
{
real scalar i
real matrix res
res = J(n, n, 0)
for (i=1; i<=n; i++) {
res[i,i] = 1
}
return(res)
}
:
: I3 = id(3)
: I3
Which gives the error: nothing found where 'while' expected
r(3000);
Any help is much appreciated.
Related Posts with MATA Error "Nothing found where while expected"
Create variable depending on many variablesHey stata community, I have a question regarding creating a new variable depending on many other va…
append iterativelyHi all, I am trying to append iteration some files (if they exist) belonging to different folders. …
Interaction Term in Log-Linear ModelHello All! I am currently writing my Bachelor’s Thesis and have a question about the interpretation …
remove last letters in a wordDear All, The data set is Code: * Example generated by -dataex-. To install: ssc install dataex cle…
Bug in wtmean?This is my first post but I hope I have strictly followed the rules. I have the following data Co…
Subscribe to:
Post Comments (Atom)
0 Response to MATA Error "Nothing found where while expected"
Post a Comment