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: graph the fitted values in a 3-way interaction with additional covariates


From   Richard Williams <richardwilliams.ndu@gmail.com>
To   statalist@hsphsun2.harvard.edu, statalist@hsphsun2.harvard.edu
Subject   Re: st: graph the fitted values in a 3-way interaction with additional covariates
Date   Fri, 24 May 2013 11:18:21 -0500

How about something like this?

webuse nhanes2f, clear
reg health c.age##female##black height weight
margins female#black, at(age=(20(5)70))
marginsplot

You could use the -atmeans- option or otherwise specify values for the other covariates.


At 07:26 AM 5/24/2013, Gentile, Elisabetta wrote:
Dear StataListers,

I have a dataset of firms grouped by country and sector of operation.
I run a linear probability model with a three-way interaction, where
my dependent variable Y is obviously a binary indicator, my
independent variable X is continuos on [0,1], the modifier W is a
binary indicator, and Z is a categorical variable that splits the data
into three groups.

I want to graph the slopes for each of the interactions, so that if I
have the simple regression:

regress Y c.X##W##Z

then for example I can do:

twoway lfit Y X, by(W Z)

which generates six charts with the slopes for each group.

The problem is that my model has additional covariates, such as sector
and year fixed effects, and other continuous variables both at the
country and firm level.

How do I graph the slopes for each of the interactions for the model
including all the covariates?  The first thing that came to mind was
avplot, but it does not accept the by() option, so I am at a loss
here.  There must be a simple solution that I am not seeing!  Your
input is much appreciated.

Regards,
Elisa
*
*   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/

-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  Richard.A.Williams.5@ND.Edu
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index