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: Understanding Factor variables  - is order significant  ?
From 
 
Richard Williams <[email protected]> 
To 
 
[email protected] 
Subject 
 
Re: st: Understanding Factor variables  - is order significant  ? 
Date 
 
Tue, 25 May 2010 22:06:35 -0500 
At 08:32 PM 5/25/2010, Michael N. Mitchell wrote:
  Extend that idea to your interaction... Suppose you flip the 
coding of your "ra" and "dm" variables. Note that the test of the 
interaction, the p value, will remain the same (assuming both are 
dummy variables). The coefficients of "ra" and "dm" will change as 
well, due to the change in coding. The details get more 
complicated, but are explained in section 3.5 of 
http://www.ats.ucla.edu/stat/stata/webbooks/reg/chapter3/statareg3.htm 
. It is explained using the old "xi" terminology, but the issues 
still are the same.
He is not changing the coding though.  He is just flipping the 
placement of the terms, i.e. b1.ra#b0.dm in one model and 
b0.dm#b1.ra.  Like using female * race versus using race * female.
I'd be curious to know if the two models did produce identical 
fits.  That would indicate whether the parameterizations are 
equivalent.  If not, then something is getting screwed up.
I suspect using ## instead of # might solve the problem -- and that 
would be my preference anyway.
The following code also produces inconsistent results, with the 3rd 
model being wrong.  It isn't clear to me why that is the case.
use "http://www.indiana.edu/~jslsoc/stata/spex_data/ordwarm2.dta", clear
ologit  warm yr89#male, nolog
ologit  warm b0.male#b1.yr89, nolog
ologit  warm b1.yr89#b0.male, nolog
I hate to accuse Stata of having a bug, but I am starting to wonder...
-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  [email protected]
WWW:    http://www.nd.edu/~rwilliam
*
*   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/