Bookmark and Share

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

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

Re: st: coefficient test in different regression models

From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: coefficient test in different regression models
Date   Mon, 4 Oct 2010 16:59:33 +0100 (BST)

--- On Mon, 4/10/10, [email protected] 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 L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen


*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index