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, is already up and running.

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

Re: st: Understanding Factor variables - is order significant ?

From   Richard Williams <>
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 . 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. in one model and 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 "";, 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:  Richard.A.Williams.5@ND.Edu

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index