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: st: How to use the Wald test when testing for interactions and heterogeneity


From   Richard Williams <[email protected]>
To   [email protected], "[email protected]" <[email protected]>
Subject   Re: st: How to use the Wald test when testing for interactions and heterogeneity
Date   Wed, 18 Sep 2013 09:35:50 -0500

At 07:59 AM 9/18/2013, Amal Khanolkar wrote:
Hi,

Could anyone tell me the right syntax for using the Wald test for the following regression models? I tried looking at the help page for the command 'test' but I wasn't able to figure it out:


Ideally I would test for heterogeneity for the following model as follows using the LRT, but this doesn't go with the cluster option:

regress syst i.ethnicity_bi2x age byear i.conscript_office if bmi!=. & height_cons!=. & education2!=. & bwtgestage_sd!=. & gestwk_catx2!=. & multibirth==1 & sex==1, cluster (mor_lopnr)
estimates store a
regress syst ethnicity_bi2x age byear i.conscript_office if bmi!=. & height_cons!=. & education2!=. & bwtgestage_sd!=. & gestwk_catx2!=. & multibirth==1 & sex==1, cluster (mor_lopnr)
lrtest a

So, are you basically trying to test whether ethnicity_bi2x can be treated as a continuous variable? Does something like this do what you want?

sysuse auto, clear
reg price mpg c.rep78 i.rep78
testparm i.rep78

If the test comes up insignificant (as it does in this case) this means that the continuous version alone is sufficient.

And similarly when testing for interactions:

xi: regress syst i.ethnicity_bi2x*bwtgestage_sd age byear i.conscript_office bmi height_cons i.education if multibirth==1 & sex==1, cluster (mor_lopnr)
estimates store A
xi: regress syst i.ethnicity_bi2x bwtgestage_sd age byear i.conscript_office bmi height_cons i.education if multibirth==1 & sex==1, cluster (mor_lopnr)
lrtest A

Why the switch to xi? If you have Stata 11 or higher, I think it should be something like

regress syst i.ethnicity_bi2x bwtgestage_sd i.ethnicity_bi2x#c.bwtgestage_sd age byear i.conscript_office bmi height_cons i.education if multibirth==1 & sex==1, cluster (mor_lopnr)

testparm i.ethnicity_bi2x#bwtgestage_sd

You may also wish to see this thread from 2 years ago:

http://www.stata.com/statalist/archive/2011-10/msg01350.html

http://www.stata.com/statalist/archive/2011-10/msg01352.html

http://www.stata.com/statalist/archive/2011-10/msg01389.html

-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  [email protected]
WWW:    http://www.nd.edu/~rwilliam

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