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


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: AW: st: graph interaction in count models
Date   Thu, 1 Apr 2010 15:36:27 +0000 (GMT)

--- On Thu, 1/4/10, D Ma <[email protected]> wrote:
> 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). 

<snip>

> I am using STATA 10.


The question marks are explained on the FAQ page I linked to at 
the bottom of my example: <http://www.maartenbuis.nl/example_faq/#w?>

The example I sent will only work in Stata 11 since I used the 
new factor variable notation. Remember that the statalist FAQ
asks you to state if you are not using the current version of
Stata, exactly to prevent this type of misunderstandings.
<http://www.stata.com/support/faqs/res/statalist.html#stata>

Below is an adjusted version of my example that will work under
Stata 10:

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

gen tenureXgrade = tenure*grade

xtgee wks_work tenure grade tenureXgrade 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
gen tenureXgrade = tenure * grade
predict wks_hat
separate wks_hat, by(tenure)
twoway line wks_hat? wks_hat?? grade, sort
restore
*--------------------- end example ------------------

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/


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