Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Nick Cox <njcoxstata@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: stcox continuous interaction issue stata 10 |
Date | Fri, 18 Mar 2011 09:26:47 +0000 |
That is, what Matt is typing is in part syntax only introduced in Stata 11. That won't work in Stata 10. On Fri, Mar 18, 2011 at 8:33 AM, Maarten buis <maartenbuis@yahoo.co.uk> wrote: > --- 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 ) > * * 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/