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

st: replacing a scalar from mat


From   "R.E. De Hoyos" <[email protected]>
To   <[email protected]>
Subject   st: replacing a scalar from mat
Date   Tue, 12 Jul 2005 19:48:13 +0300

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
________________________
R.E. De Hoyos
Faculty of Economics
University of Cambridge
CB3 9DE, UK
www.econ.cam.ac.uk/phd/red29/ *
* 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