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: Simple slopes analysis in fixed effects panel regression


From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: Simple slopes analysis in fixed effects panel regression
Date   Mon, 6 Jan 2014 11:20:19 +0100

On Sun, Jan 5, 2014 at 4:13 PM, Maartje Groenewegen wrote:
> Currently I am conducting a fixed effects panel regression which includes a
> marginal significant (p=0.067) two-way interaction term consisting of two
> mean centered continuous variables.
> I would like to perform a simple slopes analysis on this interaction, but I
> don’t know how to do it.

*------------------------ begin example -------------------------
// load some example data
webuse nlswork, clear
xtset idcode

// center your variables  (noone works 7 days a week 24 hours a day)
gen chours = cond(hours > 112, 112, hours) if hours < .
sum chours , meanonly
replace chours = chours - r(mean)
sum tenure , meanonly
gen ctenure = tenure - r(mean)

// estimate the model
xtreg ln_w age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure ///
            c.ctenure#c.ctenure not_smsa south chours c.chours#c.ctenure, fe

// the simple slopes
margins, dydx(chours) at(ctenure=(-3(1)22))

// look at a graph
marginsplot
*------------------------ end example ---------------------------


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/


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