Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: AW: how do I get a stata matrix into mata?


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: how do I get a stata matrix into mata?
Date   Mon, 21 Sep 2009 17:31:37 +0200

<> 

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index