Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: replacing a scalar from mat


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   st: Re: replacing a scalar from mat
Date   Tue, 12 Jul 2005 14:33:12 -0400

If you know that you are only extract one row and column, why not
mat B = e(b)
mat B1 = B["y1","eq1:x1"]
scalar s=B1[1,1]

Michael Blasnik
[email protected]

----- Original Message ----- From: "R.E. De Hoyos" <[email protected]>
To: <[email protected]>
Sent: Tuesday, July 12, 2005 12:48 PM
Subject: st: replacing a scalar from mat



I am trying to get a scalar from a matrix (vector). Within a multiple equations framework (-mlogit-) I want to get one of the parameters estimated. After running -mlogit- I tried the following:

mat B = e(b)
scalar s = B["y1","eq1:x1"]

The following error appears:

matrix operators that return matrices not allowed in this context
r(509);

However if I try one of the following, there is no error reported:

mat A = B["y1","eq1:x1"]
scalar s = B[1,1]

Using the rows and columns names of the matrix is important since these scalars will be replaced into a second vector of estimated parameters.

Thanks,

Rafa
*
*   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/



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