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

Re: st: Matrix subscripts using row and column names

From (Vince Wiggins, StataCorp)
Subject   Re: st: Matrix subscripts using row and column names
Date   Thu, 17 Jul 2003 16:33:30 -0500

Bill Gould <> explained to West Addison <>
why matrix expressions such as


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

    . generate sdif = dif / sqrt(V["price", "price"])

will not work.  However,

    . generate sdif = dif / sqrt(V[rownumb(V,"price"), colnumb(V,"price")])


-- Vince

*   For searches and help try:

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