Statalist


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

st: Matrix manipulation.


From   Victor Mauricio Herrera <[email protected]>
To   statalist <[email protected]>
Subject   st: Matrix manipulation.
Date   Thu, 01 May 2008 12:18:50 -0500

Hi All,

I'm running a regression model and then using the matrix of coefficients
e(b) for additional calculations. In the model I have an interaction term
between two dichotomous variables (i.e. gender-by-obesity, with women coded
as 0 and men coded as 1). The coefficient for obesity in women is already in
e(b) but not the coefficient for obesity in men. I know I can easily
calculate this coefficient using lincom, but the problem is that I need to
add the coefficient for obesity in men as an additional column to the e(b)
matrix, to be able to do additional calculations using e(b). In not very
familiar with matrix manipulation and I wonder if there is an easy way to do
this. My code looks like this:

regress bp obesity gender gen-by-obesity
matrix Q = nullmat(a)\e(b)

And I need to add the coefficient for obesity in men to "Q".

Thanks in advance,


VICTOR M. HERRERA
PhD., Student 
Population Health Sciences
University of Wisconsin
610 Walnut St. 632 WARF
Madison, WI 53726
(608) 265-3686
*
*   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