<>
Alternatively, construct the vector in -mata- in the first place:
*************
mata: mata clear
sysuse auto, clear
gen constant=1
capt ssc inst tomata
di in red _rc
tomata price constant weight trunk
mata
X=(weight, trunk, constant)
y=price
b=invsym(X'*X)*X'*y
b
//for comparison:
mata stata reg price weight trunk
end
*************
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Miriam Wüst
Gesendet: Montag, 21. September 2009 17:21
An: [email protected]
Betreff: st: how do I get a stata matrix into mata?
I can only make the other way work (from mata to stata) - what if I want to
"send" a stata vector containing e(b) to mata?
Thanks!
Miriam
______________________________________________
MIRIAM WÜST
PHD STUDENT
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/