Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: matrix colnames, Kronecker direct products, and factor variables


From   Steve Samuels <[email protected]>
To   [email protected]
Subject   Re: st: matrix colnames, Kronecker direct products, and factor variables
Date   Wed, 4 Dec 2013 18:35:20 -0500

Note that factor variable names are not equation names.  The following version (you seem to have switched A & B) produce column names that are a combination of those from A & B.

matrix colnames B = eqn1:_new eqn1:_old
matrix C =  A # B


Steve


On Dec 4, 2013, at 3:02 PM, Doug Hemken wrote:

I don't get what I expect. The documentation I find says the columns of the product matrix, A # B, will have names from matrix B and equation names from matrix A?

But if I have factor variable names for the columns of A, they simply disappear in the product. (I also notice that when I assign column names that appear to be factor variables or interaction terms, Stata alters my labels, usually for the better.)

For example:
matrix A = (1,21 \ 0 ,1)
matrix colnames A = _cons mpg
matrix B = I(2)
matrix colnames B = 0.foreign 1.foreign


matrix C = B' # A
matrix list A
matrix list B
matrix list C


The column labeling on C is not what I expect!
--
Doug Hemken
4226I Social Science Bldg.

[email protected]
262-4327

To make a consulting appointment send me an email, or use the on-line scheduler:
https://calendar.wisc.edu/scheduling-assistant/public/profiles/PlRxCykH.html
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index