Statalist


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

st: Interacting continuous variable with a factor variable using c. as the prefix for the continuous variable


From   "Weichle, Thomas" <[email protected]>
To   <[email protected]>
Subject   st: Interacting continuous variable with a factor variable using c. as the prefix for the continuous variable
Date   Fri, 8 Jan 2010 14:09:04 -0600

Hi Statalisters,
I'm trying to create an interaction with a continuous variable and a
factor variable using c. as the prefix for the continuous variable.  How
come I receive different results when using the following model syntax?
I understand that some of the output interpretations are slightly
different but things like the log likelihood, LR chi2, and degrees of
freedom should be the same.

Model 1:
stcox chemo#c.income

Model 2:
stcox chemo##c.income

Model 2 is equivalent to the following model:
gen chemo_income = chemo*income
stcox chemo income chemo_income

Model 1 contains exactly 1 less degree of freedom.  It is not clear to
me why Model 1 and Model 2 aren't equivalent.

I was able to demonstrate that when interacting 2 factor variables the
following models would be equivalent:
stcox chemo#male
stcox chemo##male

However, I'm having a hard time showing the equivalency of interacting a
continuous and factor variable.

Tom Weichle
Math Statistician
Center for Management of Complex Chronic Care (CMC3)
Hines VA Hospital, Bldg 1, C202
708-202-8387 ext. 24261
[email protected] 

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index