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

st: RE: Accessing regression coefficients for dummy variables created with xi command


From   "David Harrison" <[email protected]>
To   <[email protected]>
Subject   st: RE: Accessing regression coefficients for dummy variables created with xi command
Date   Thu, 7 Jul 2005 09:21:41 +0100

The coefficients from your regression are returned in the matrix e(b), you can get them into a variable by using -svmat-, e.g.

sysuse auto
xi: reg price i.rep78
matrix b = e(b)'  /* note the transpose... e(b) is a row vector */
svmat b
summ b1

This has included all the coefficients in the model, to include only the ones created by -xi- would need a little more work. If you know the names of the first and last variables you want to include, then one additional statement (before the -svmat- command) would do, e.g.

matrix bxi = b["_Irep78_2".."_Irep78_5", 1]
svmat bxi
summ bxi1

Hope this helps

David

-----Original Message-----
From: Amit Nigam [mailto:[email protected]]
Sent: 07 July 2005 00:34
To: [email protected]
Subject: st: Accessing regression coefficients for dummy variables
created with xi command



Greetings netters!

I am having trouble with what for many of you will be a basic question.  I 
want to access regression coefficients for dummy variables created using 
the xi command.  What I am trying to do is as follows:

1. Run a regression and calculate coefficient for about 400 dummies created 
using xi
2. Capture those coefficients
3. Summarize the mean and standard deviation of the coefficients

I looked for help in [U] 16.5 Accessing coefficients and standard errors  - 
but am at a total loss.

Is there another place in the manuals where I should be turning?  Other 
thoughts?

Many thanks

Amit





____________________________________________________________
Amit Nigam
Doctoral Student, Management & Organizations and Sociology
Kellogg School of Management, Northwestern University

*
*   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/



*
*   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