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: Re: st: extracting coefficients from an -estimates- table


From   "Ariel Linden" <[email protected]>
To   <[email protected]>
Subject   re: Re: st: extracting coefficients from an -estimates- table
Date   Thu, 13 Feb 2014 12:00:43 -0500

Hi Daniel,

I very specifically want to run two (or more) regressions and subtract one
value from another - as in my example below.

The reason is to demonstrate (to my students) how interactions work within a
single regression (as you've noted), by showing how the values are derived
when the regressions are run separately. 

Thus, the example below is what I'd like to use for this demonstration

Thanks!

Ariel


Re: st: extracting coefficients from an -estimates- table
________________________________________
From
  daniel klein <[email protected]>
To
  "[email protected]" <[email protected]>
Subject
  Re: st: extracting coefficients from an -estimates- table
Date
  Thu, 13 Feb 2014 17:53:08 +0100
________________________________________
Ariel, I might misunderstand or simplify the problem at hand, but you
get this difference (and an additional significance test) from

. regress price c.mpg##i.foreign
. di _b[1.foreign#c.mpg]

Ask for a straight forward way, in the sense of e.g. -get()-, to
extract the values from -r(coef)-, I am not aware of such a command.
What you want is probably programmable with a few lines of code,
though. We would of course need a more detailed explanation beyond the
stylized example to illustrate the point.

Best
Daniel

-- 
Hi All,

I would like to extract some values from stored estimates, but I am not sure
if there is a straightforward way other than extracting the values from the
r(coef) matrix? In the example below, I'd like to do the equivalent of :
domestic[mpg] - foreign[mpg]

****example*****
. sysuse auto
. regress price mpg if foreign==0
. estimate store domestic
. regress price mpg if foreign==1
. estimate store foreign
. estimate table domestic foreign



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