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 on April 23, and its replacement, statalist.org is already up and running.


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

Re: AW: st: graph interaction in count models


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
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 <lrpwhn@yahoo.com> 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index