Re: st: Matrix subscripts using row and column names

Bill Gould <wgould@stata.com> explained to West Addison <wastata@yahoo.com>
why matrix expressions such as
V["price","price"]
cannot be used in a scalar context. While I agree complete with Bill's
explanation (I think I am required to by contract), West might be interested
in a "back door" way of evaluating the expression on one line. Whereas the
matrix subscripting logic is geared toward efficiency, as Bill described, the
-rownumb()- and -columb()- functions are not so picky. West's original
example,
. generate sdif = dif / sqrt(V["price", "price"])
will not work. However,
. generate sdif = dif / sqrt(V[rownumb(V,"price"), colnumb(V,"price")])
will.
-- Vince
vwiggins@stata.com
*
* 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/