Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AW: st: graph interaction in count models

From   Maarten buis <>
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 <> 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). 


> I am using STATA 10.

The question marks are explained on the FAQ page I linked to at 
the bottom of my example: <>

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.

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)

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

Hope this helps,

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


*   For searches and help try:

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