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: stcox continuous interaction issue stata 10


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: stcox continuous interaction issue stata 10
Date   Fri, 18 Mar 2011 08:33:23 +0000 (GMT)

--- On Fri, 18/3/11, Matt Cooper wrote:
> I'm putting 'xi: ' at the start given I'm using Stata10. It
> seems to not like the idea of having the interaction between
> the two continuous variables. The interactions with the
> indicator variables work when I use '*' instead of '#'. 

The factor variable notation is a biger change than just 
preventing the -xi:- prefix. To see the exact syntax of -xi-
type in Stata -help xi-. You'll see that -xi- is primarily 
there to "expand terms containing categorical variables into 
indicator (also called dummy) variable sets". So it comes
as no surprise that it cannot handle continuous by 
continuous interactions. So, you'll have to make the 
interaction terms yourself. Since treat and site are already
dummy variables, there is no added value to using the -xi:-
prefix in this example (and a loss in the sense that you get 
less intuitive variable names).

*------------------- begin example ------------------
use http://www.ats.ucla.edu/stat/data/uis.dta, clear
gen id = ID
drop ID
stset time, failure(censor)
gen ageXndrugtx = age*ndrugtx
stcox age ndrugtx treat site ageXndrugtx, nohr
*------------------ 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/


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