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: base category in margins output


From   Eduardo Nunez <[email protected]>
To   [email protected]
Subject   st: base category in margins output
Date   Tue, 18 Oct 2011 12:53:29 -0400

Dear Statalisters,
I have an interaction between a 4-level variable (1 to 4) and a
continuous one (range between 0 to 21).
Running a univariate Cox regression and margins afterward, I got
defined the base category for the reported hazard ratios listed in the
margins output (HR=1).
However, when I run the same interaction, but, this time adjusted for
other covariates, the margins output doesn't show the same HR (=1)
even though is the base category.

This is the example:

Four-level variable (composed by grouping 2 binary variables)
urea_2_ca35 |    urea_2      ca35
------------+--------------------
          1 |         1         0
          2 |         0         0
          3 |         0         1
          4 |         1         1
------------+--------------------

LED_sqrt=continuous variable with range from 0 to 21

Univariate Cox model (with level "1" as base category for urea_2_ca35
and "0" for LED_sqrt)
stcox i.urea_2_ca35##c.LED_sqrt, efron

Then I run margins as shown:
margins, at(LED_sqrt=(0(3)21) (asobserved) _all) over(urea_2_ca35) post

---------------------------------------------------------------------------------
                |            Delta-method
                |     Margin   Std. Err.      z    P>|z|     [95%
Conf. Interval]
----------------+----------------------------------------------------------------
_at#urea_2_ca35 |
           1 1  |          1          .        .       .            .
         .
           1 2  |   .8365883   .4008474     2.09   0.037     .0509418
  1.622235
           1 3  |   .3564519   .1606048     2.22   0.026     .0416723
  .6712315
more output not shown............

I did show me (as expected) that all estimates (in hazard ratios
scale) are using the category "11" as base category.


So far so good. However, things get confused when I run the same
interaction in a multivariable Cox.

stcox Iedad__1 sexo dm_i obesidad_i primer_ingreso_i portador_de_dai
pad iam demencia nyha3_4 efLT50##c.sbp_i acxfa##c.fc_i br_i
edemas_tm_i derrame_pleural_i ///
Ina_i__1 Ina_i__2 Iac_u__1 Ibnp___1 Ipcr___1 Icole__1 bbloq_previo_i
bbloq estatina nitratos ieca i.urea_2_ca35##c.LED_sqrt, efron

Then I run the same margins as before:
margins, at(LED_sqrt=(0(3)21) (asobserved) _all) over(urea_2_ca35) post

And I got a hazard ratio for the category "11" of 1.446149

---------------------------------------------------------------------------------
                |            Delta-method
                |     Margin   Std. Err.      z    P>|z|     [95%
Conf. Interval]
----------------+----------------------------------------------------------------
_at#urea_2_ca35 |
           1 1  |   1.446149    .555207     2.60   0.009     .3579634
  2.534335
           1 2  |   1.133821   .6742893     1.68   0.093    -.1877618
  2.455403
more output not shown............

Can anyone explain me the meaning of this HR? It is not suppose to be
1 (base category for both interacting variables)?

I appreciate any help in understanding this wonderful addition
(margins & marginsplot) to Stata 11 & 12.

I am using Stata 12 updated 13oct2011

Best regards,
Eduardo
*
*   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