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]

st: Understanding Factor variables - is order significant ?


From   "Jesper Lindhardsen" <[email protected]>
To   <[email protected]>
Subject   st: Understanding Factor variables - is order significant ?
Date   Wed, 26 May 2010 00:22:27 +0200

Dear Statalisters, 
 
I am having a hard time understanding why 2 regression models that
differ only by the "order" of the included factor variables yield
different results??? 
I can't (or am too slow to) find the answer in the documentation, but I
think it is related to the parsing of the baselevel specifiers (see
model 1 legend = _b[0o.ra#0b.dm] ???).

Here are the 2 commands and resulting output - as you can see I've only
changed b1.ra#b0.dm to b0.dm#b1.ra. Output has been edited, but only
left out if identical between models.

(System: Stata 11/MP for windows, born 10 feb 2010)
 
1)
poisson _d b1.ra#b0.dm i.alder_k sex if ex==0, e(risk_tid) irr
coeflegend
			
_d          IRR       Legend
			
ra#dm 
0 0     1.487748  _b[0o.ra#0b.dm]
0 1     1.968017  _b[0.ra#1.dm]
1 1     2.787839  _b[1b.ra#1.dm]
             
alder_k 
1     6.176815  _b[1.alder_k]
2     18.09798  _b[2.alder_k]
             
sex    2.070646  _b[sex]
risk_tid  (exposure)
			
2)

poisson _d b0.dm#b1.ra i.alder_k sex  if ex==0, e(risk_tid) irr
coeflegend

			
_d         IRR         Legend
			
dm#ra 
0 0     .5935912  _b[0b.dm#0.ra]
1 0     1.169963  _b[1.dm#0.ra]
1 1      1.65762  _b[1.dm#1b.ra]
             
alder_k 
1     6.171095  _b[1.alder_k]
2     18.07456  _b[2.alder_k]
             
sex    2.072329  _b[sex]
risk_tid  (exposure)
			 
Hope its not too elementary.....
		
Thanks you all for your contributions to statalist, it's a really
valuable source of information for me.
Regards,


Jesper Lindhardsen
MD, Ph.d. student
Department of Cardiovascular Research
Copenhagen University Hospital, Gentofte
Denmark


*
*   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