Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error with likelihood ratio test in Cox model

    Hello,

    I have been using Stata 12.1 for an analysis of potential predictors of breast cancer using a Cox PH model. I have used purposeful selection of covariates to do this with the removal of one covariate form the model at a time, checking if the restricted model fits the data better than the unrestricted model using the likelihood ratio test.
    For one particular binary variable, I get an error message indicating that df(unrestricted) = df(restricted) = 11. I am not sure why this occurs when other binary variables do not produce the same error message. I have included the syntax and output below. I can't seem to find any information on this in the Stata manual or elsewhere on the web.
    I have two questions:
    1. Why does this error occur?
    2. What can I do to stop this happening?

    Thanks for any replies in advance.

    stcox i.base_seifa age_55 famhistory HRT_everscr i.radclass1

    failure _d: brcanc == 1
    analysis time _t: survival/365.25

    Iteration 0: log likelihood = -95.00942
    Some output omitted
    Iteration 39: log likelihood = -84.849624
    Refining estimates:
    Iteration 0: log likelihood = -84.849624

    Cox regression -- no ties

    No. of subjects = 472 Number of obs = 472
    No. of failures = 16
    Time at risk = 4925.859001
    LR chi2(11) = 20.32
    Log likelihood = -84.849624 Prob > chi2 = 0.0411

    ------------------------------------------------------------------------------
    _t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    base_seifa |
    2 | .602133 .5143759 -0.59 0.553 .1128621 3.212453
    3 | .2810784 .2696956 -1.32 0.186 .0428644 1.843139
    4 | 1.069854 .8350335 0.09 0.931 .2317137 4.939662
    5 | .0854596 .1069236 -1.97 0.049 .0073582 .9925427
    |
    age_55 | 1.660884 .9346858 0.90 0.367 .5512056 5.004549
    famhistory | 9.448359 6.712555 3.16 0.002 2.347594 38.02679
    HRT_everscr | .5645403 .3188802 -1.01 0.311 .1865926 1.70803
    |
    radclass1 |
    2 | 1.034481 .7990494 0.04 0.965 .2276361 4.701148
    3 | 2.530385 1.955077 1.20 0.230 .5565623 11.50428
    5 | 3.595913 4.191761 1.10 0.272 .3660685 35.32287
    6 | 1.865725 2.135031 0.54 0.586 .1980524 17.5758
    8 | 4.78e-18 . . . . .
    ------------------------------------------------------------------------------

    . est store A

    .
    . stcox i.base_seifa famhistory HRT_everscr i.radclass1

    failure _d: brcanc == 1
    analysis time _t: survival/365.25

    Iteration 0: log likelihood = -95.00942
    Some output omitted
    Refining estimates:
    Iteration 0: log likelihood = -85.253933
    Iteration 1: log likelihood = -85.253933
    Iteration 2: log likelihood = -85.253933

    Cox regression -- no ties

    No. of subjects = 472 Number of obs = 472
    No. of failures = 16
    Time at risk = 4925.859001
    LR chi2(11) = 19.51
    Log likelihood = -85.253933 Prob > chi2 = 0.0525

    ------------------------------------------------------------------------------
    _t | Haz. Ratio Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    base_seifa |
    2 | .5719933 .4931877 -0.65 0.517 .1055511 3.099697
    3 | .2410395 .2312196 -1.48 0.138 .036776 1.579836
    4 | 1.007801 .7853858 0.01 0.992 .21879 4.642177
    5 | .0896936 .1118262 -1.93 0.053 .0077897 1.03277
    |
    famhistory | 11.36945 7.834723 3.53 0.000 2.9456 43.88389
    HRT_everscr | .5960093 .3345016 -0.92 0.356 .198394 1.790514
    |
    radclass1 |
    2 | 1.036799 .8036443 0.05 0.963 .22694 4.736727
    3 | 2.941625 2.216995 1.43 0.152 .6715337 12.88566
    5 | 3.066081 3.527115 0.97 0.330 .3216551 29.2265
    6 | 2.319431 2.624937 0.74 0.457 .2523848 21.31571
    8 | 2.35e-14 1.55e-06 -0.00 1.000 0 .
    ------------------------------------------------------------------------------

    . lrtest A //fits better without age_55
    df(unrestricted) = df(restricted) = 11
    r(498);




    Liz

  • #2
    What does the crosstab of age_55 and radclass1 look like? Category 8 of radclass 1 seems awfully shaky, especially in the first model, where it seems to drop out.

    Incidentally output is easier to read if you use CODE tags. Click on the A (next to the smiley on the upper right when writing a message). Then click # and paste in between the two code tags that are generated.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Hi Richard,

      Thanks for the tip.

      Crosstab is below:
      Code:
       tab age_55 radclass1, missing
      
      < or >= 55 |
              at |                    Rad lesion 1 classification
       diagnosis | calcifica  stellate   discrete   architect  non-speci      other |     Total
      -----------+------------------------------------------------------------------+----------
             <55 |       164         92         27         11         19          0 |       313
            >=55 |        87         42         19          2          8          1 |       159
      -----------+------------------------------------------------------------------+----------
           Total |       251        134         46         13         27          1 |       472
      Liz

      Comment


      • #4
        My apologies, the below output is correct for the crosstab.

        Code:
        . tab age_55 radclass1 if adhtag==1, missing
        
        < or >= 55 |
                at |                    Rad lesion 1 classification
         diagnosis | calcifica  stellate   discrete   architect  non-speci      other |     Total
        -----------+------------------------------------------------------------------+----------
               <55 |        62         26          9          4          2          0 |       103
              >=55 |        50         14         16          1          6          1 |        88
        -----------+------------------------------------------------------------------+----------
             Total |       112         40         25          5          8          1 |       191
        Cheers,
        Liz

        Comment


        • #5
          Actually, I wonder if the first is right -- N = 472, which is what you had in the stcox runs.

          Either way, though, category 8 of radclass1 only has 1 case. And if you are a 1 on age_55 you know you are a 1 on radclas1 = 8. I think you need to combine or drop some categories of radclass1. None of the radclass variables had significant effects anyway. I have no idea what these categories mean, but if there was a theoretically reasonable way to collapse into 2 or 3 categories (e.g. calcification vs everything else) I'd be tempted to do it.
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment


          • #6
            Thanks a lot Richard, that helps me enormously.

            I had looked at reducing radclass1 to exactly what you suggest, I will go back to that approach now.

            Again, many thanks

            Liz

            Comment

            Working...
            X