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

st: graphing results from reg3


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: graphing results from reg3
Date   Fri, 9 May 2003 10:00:04 -0400

John said:
I was wondering how to access and use the coefficient estimates from a multiline
estimation command.

Lets say my model looked like:
-reg3 (eqn1: Y X1 X2 X3) (eqn2: Y X1 X4 X5), endog(Y X1)

I'd like to make a graph of eqn1 w/ Y on the vertical axis, and X1 on the horizontal.
The intercepts are, then, the Data multiplied by the other Xs.

The problem is that I've got many many of these regressions, and I'd rather not have to
cut and paste coefficient estimates from the regression output. Am I making sense? Lets
say I get an estimate of 0.25 for X1 and 0.80 for X2. I'd rather not have cut-and-paste
my way through:
-gen intercept1 = X2*0.25 + X3*0.80

Is there a way to do this by referncing the estimate directly, rather than typing in the
0.25 business.

It seems like this could be done with predict:

reg3 (eqn1: price mpg rep78 weight) (eqn2:mpg length turn)
predict phat,eq(eqn1)
graph7 phat weight

Doesn't this do what you're describing? After all for each value of (X2,X3) you will have a value
of 'intercept'. You certainly can retrieve the coefficients after reg3 and manipulate them, but I would think you
could get there more easily by using x-betahat for the specified equation.

Kit

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