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

# Re: st: Comparing mean of two regression models

 From David Ashcraft To "statalist@hsphsun2.harvard.edu" Subject Re: st: Comparing mean of two regression models Date Sun, 11 Dec 2011 03:28:41 -0800 (PST)

```Thanks Joegr for the previous e-mail. I have got the solution from a previous post.

sysuse auto, clear
qui reg pr mpg if for==1
est sto f
qui reg pr mpg if for==0
suest f .
test [f_mean]_cons=[_LAST_mean]_cons

----- Original Message -----
From: Joerg Luedicke <joerg.luedicke@gmail.com>
To: statalist@hsphsun2.harvard.edu
Cc:
Sent: Sunday, December 11, 2011 10:02:31 AM
Subject: Re: st: Comparing mean of two regression models

Why not using a y2Xdummy interaction term?

However, if you want to do it that way you could use -suest-. Here is
an example:

*----------------------------------
sysuse auto
reg price mpg if foreign==0
est sto m1
reg price mpg if foreign==1
est sto m2
suest m1 m2, coefl
test _b[m1_mean:mpg]=_b[m2_mean:mpg]
*----------------------------------

Joerg

On Sun, Dec 11, 2011 at 1:05 AM, David Ashcraft
<ashcraftd@rocketmail.com> wrote:
> This question seems dumb to me but somehow I am messed up. I am trying to compare the coefficients of two models. The data set is divided among two group by a dummy variable.
>
> reg y1 y2 if dummy==0
> est store con
> reg y1 y2 if dummy==1
> est store imf
> test [con_y2=imf_y2]
>
> I get the following response after the last command
>
> r(303);
>
> Can somebody guide me where I am wrong or how should I perform this test?
> Regards
>
> David
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/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/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/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```