Statalist


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

st: AW: matrices stata and mata


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: matrices stata and mata
Date   Mon, 30 Mar 2009 17:04:15 +0200

<> 



*************
sysuse auto, clear

//get tomata package
cap ssc inst tomata
di in red _rc

tomata price weight foreign
mata
X=(price, weight, foreign)
// constructed X, admittedly in two steps

// get some matrix from Stata into mata
mata stata regress price weight foreign
beta=st_matrix("e(b)")
// let`s see
beta
//push beta back to Stata
st_matrix("bs", beta)
end
//let`s see resulting matrix "bs" back in Stata
mat l bs
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Carlos Garcia
Gesendet: Montag, 30. März 2009 16:30
An: [email protected]
Betreff: st: matrices stata and mata

Dear StataList members:

I have a couple of questions about mata and stata:

-In mata, how to get more than one variable from stata in a matrix, in
one single step?
-how to read a matrix from mata in stata?

Thanks!

Carlos Garcia
LSU 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