Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: coefficient test in different regression models


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: coefficient test in different regression models
Date   Mon, 4 Oct 2010 16:59:33 +0100 (BST)

--- On Mon, 4/10/10, a.carrozzone@libero.it wrote:
> I have two linear models and they are estimated over
> different samples. The models are non-nested but they
> have some coefficients in common.
> 
> I would like to test the hypothesis that one of the
> coefficients in common is the same across the two
> different models.
> 
> Is there a standardized test to do this in STATA?

Issues like these are often best solved by estimating
one model with the appropriate interaction terms.
In your case you might add some aditional constraints
to set the coeficients for the variables you want 
to leave out at 0.

Consider the following example. We have two samples,
foreign and domestic cars. We want to explain price
of domestic cars mpg and rep78, while we want to
explain the price of foreign cars only with rep78.
By using # instead of ## you get the effects of 
mpg and rep78 in each of our sub-samples separately
rather than the difference in effect. I found out
how to name these coeficients in the -test- and 
-constraint- comand by first estimating the model
with the -coefl- option.

*--------------- begin example -----------
sysuse auto, clear
constraint 1  _b[1.foreign#c.mpg] = 0
cnsreg price c.mpg#i.foreign   ///
             c.rep78#i.foreign ///
             i.foreign, constr(1) 

test _b[0b.foreign#c.rep78] = _b[1.foreign#c.rep78]
*------------------ end example -------------

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

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


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index