Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: using "/" symbol in matrix row names, Stata 10


From   jpitblado@stata.com (Jeff Pitblado, StataCorp LP)
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: using "/" symbol in matrix row names, Stata 10
Date   Mon, 04 Feb 2008 18:10:03 -0600

Zurab Sajaia <zsajaia@hotmail.com> asks about using "/" in matrix stripes:

> This question might refer to the StataCorp folks but I still decided to post 
> it here. And apologies for asking it again but the last time it was part of 
> another discussion and I guess escaped most of the people's attention.
> 
> In the previous versions it was legitimate to write:
> 
> . mat a=4
> . mat rownames a = /name
> 
> and the result was as expected (by me):
> 
> . mat list a
> symmetric a[1,1]
>       c1
> /name   4
> 
> . mat rownames a = eqn:/name
> 
> . mat list a
> symmetric a[1,1]
>       c1
> eqn:/name   4
> 
> Now if I try to do the same thing in Stata 10:
> 
> . mat a=4
> . mat rownames a = /name
> . mat list a
> symmetric a[1,1]
>       c1
> name:_cons  4
> 
> and in the second case:
> 
> . mat rownames a = eqn:/name
> /name invalid name
> 
> Since I'm using "/" symbol in the matrix row names in one of my programs I'd 
> really like to know if it's a bug in Stata 10 that might be fixed some time 
> soon or the change in behavior was intentional (I couldn't find any changes 
> in the help file) and I need to modify my program in order for it to keep 
> working.

This change was intentional.

As Zurab has shown above, -matrix rownames- and -matrix colnames- in Stata 10
interpret "/name" to mean "name:_cons" so "eq:/name" is now an invalid
syntax.  This change was made to make matrix stripe logic consistent with how
-_b- and -_se- are interpreted.  Here is an example of what I mean.

	. sysuse auto
	  (output omitted)

	. intreg mpg mpg
	  (output omitted)

	. di _b[/lnsigma]
	1.3469236

The above works in Stata 10 and earlier.

Now, in Stata 10 you can also do

	. matrix b = 55, 1.5

	. matrix colname b = /xb /lnsigma

	. matrix list b

	b[1,2]
	          xb:  lnsigma:
	       _cons     _cons
	r1        55       1.5

-ml- has advertised this short-cut notation since Stata 6, so we didn't
foresee that this would cause anyone trouble.  We regret the trouble we have
caused Zurab.

--Jeff
jpitblado@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/



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