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

# Re: st: comparison of coefficients of the same variable across two log-linear models with t-test

 From Maarten Buis To statalist@hsphsun2.harvard.edu Subject Re: st: comparison of coefficients of the same variable across two log-linear models with t-test Date Mon, 9 Dec 2013 10:16:46 +0100

```On Mon, Dec 9, 2013 at 8:12 AM, James Bernard wrote:
> I wonder if equality of coefficient of the same variable across two
> similar models  that are run on two different samples can be tested
> using t-test.
>
> Y=a+b1X (run on sub-sample 1)
> Y=a+b2X (run on sub-sample 2)

I assume you do not want to constrain the constants to be the same in
both sub-samples, i.e. the a in your equations should have been a1 and
a2.

In that case you can estimate the entire model in one go, as in the
example below:

*------------------ begin example ------------------
webuse epilepsy
xtset subject
xtpoisson  seizures i.treat##(c.lbas c.lage i.v4), irr
*------------------- end example -------------------
* (For more on examples I sent to the Statalist see:
* http://www.maartenbuis.nl/example_faq )

The indicator variable (some prefer the word dummy variable, I don't)
treat identifies your sub-samples. Lets say your X is lbas in this
example. So the test whether the effect of lbas is the same in the
treated and non-treated group is reported directly in the output next
to treat#c.lbas. So the effect of lbas is about (1-1.42)*100% = 42%
larger in the treated group as in the non-treated group. Note that I
used the -irr- option to ensure that I could use this interpretation
of the output. See: (Buis 2010) for more on how to interpret
interaction terms in such non-linear models. Notice however that in
this example the hypothesis that this difference is 0% could not be
rejected at the 5% level, it could however be rejected at the 10%
level.

M.L. Buis (2010) "Stata tip 87: Interpretation of interactions in
non-linear models", The Stata Journal, 10(2), pp. 305-308.
<http://www.stata-journal.com/article.html?article=st0194>

Hope this helps,
Maarten

---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------
*
*   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/
```