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: graph interaction in count models


From   D Ma <[email protected]>
To   [email protected]
Subject   Re: st: graph interaction in count models
Date   Thu, 1 Apr 2010 07:34:41 -0700 (PDT)

Hi Maarten,

Thanks for the advice.  It looks like STATA cannot finish the programming when it involves things like c.grade or c.tenure##c (I also don't know why there were question marks ?? in your codes).  Could you please resend, possibly in a format like .pdf?   In addition, suppose x2 moderates the effect of x1 on y, I am looking the the differences of the predicted probabilities in three scenarios: (1) -1 SD(x2), mean(x2), and +1 SD(x2).  Thanks!

Best regards,

Dali



----- Original Message ----
From: Maarten buis <[email protected]>
To: [email protected]
Sent: Thu, April 1, 2010 4:12:05 AM
Subject: Re: st: graph interaction in count models

--- On Wed, 31/3/10, D Ma wrote:
> I am trying to graph an interaction between two continuous
> covariates in a count model (xtgee y x1 x2 x1*x2 ...,
> family(nb) link(log) vce(robust) nolog).  Do you have
> any suggestions as to how draw such a graph?  Thanks!

*------------------ begin example --------------------
webuse nlswork, clear
xtset idcode year
gen black = race == 2 if inlist(race, 1, 2)

xtgee wks_work c.tenure##c.grade south black, /// 
      family(nb) link(log)

preserve
replace south = 0
replace black = 0
keep if e(sample)
bys grade: keep if _n == 1
expand 5
drop tenure
bys grade: gen tenure = (_n -1)*5
predict wks_hat
separate wks_hat, by(tenure)
twoway line wks_hat? wks_hat?? grade, sort
restore
*--------------------- end example ------------------
(For more on examples I sent to the Statalist see: 
http://www.maartenbuis.nl/example_faq )

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

*
*   For searches and help try:
*  http://www.stata.com/help.cgi?search
*  http://www.stata.com/support/statalist/faq
*  http://www.ats.ucla.edu/stat/stata/



      
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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