Announcement

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

  • How to suppress categorical outputs in proportional hazard model

    Hi everyone,

    I have a question about how to output part of the regression results for main IVs in the cox proportional hazard model.

    For instance, my code is something like : stcox age ndrugtx treat site

    In the regression result, I only want to keep the result for age while suppressing coefficients for other variables.

    I wonder if anyone knows how to achieve this in Stata?

    Thanks



  • #2
    You cannot do that to the -stcox- output directly. However, if you pass the results through -esttab- or -estout-, you can use -keep()- and -drop()- options to show only those coefficients you want to show.

    Comment


    • #3
      Originally posted by Clyde Schechter View Post
      You cannot do that to the -stcox- output directly. However, if you pass the results through -esttab- or -estout-, you can use -keep()- and -drop()- options to show only those coefficients you want to show.
      Hi Clyde,

      Thanks a lot for your reply. I've used code below to get an output of the coefficients and significance of the variables:

      However, I wonder if you know how to add the significance level of model (e.g. Prob>chi2=0.7957) into the output?

      Thank you and look forward to your reply.

      Code:
      esttab, label keep(age)
      Click image for larger version

Name:	2.PNG
Views:	2
Size:	39.3 KB
ID:	1656421

      Comment


      • #4
        I think you can do that by specifying the -scalars(chi2)- option in -esttab-.

        Added: No, sorry that's the chi square statistic, not the p-value. It seems -stcox- does not return the overall p-value in e(), so I don't believe it is possible to get it into the -esttab- output. At least I don't know how.

        I suspect the reason that the model p-value is not returned in e() is because it is seldom, if ever, of real interest. I see, in your case, there are only 2 model df, so with that few variables, perhaps that is of more interest than it would usually be. I would also note, however, that your N is only 11, and maximum likelihood estimation is asymptotically correct in large samples. And with N = 11 and 2 predictors, you barely have 5 observations per predictor, which means your model is probably overfit to the noise in the data. So I'm not sure that that p-value would mean much even if you could somehow extract it.
        Last edited by Clyde Schechter; 26 Mar 2022, 14:45.

        Comment


        • #5
          Originally posted by Clyde Schechter View Post
          I think you can do that by specifying the -scalars(chi2)- option in -esttab-.

          Added: No, sorry that's the chi square statistic, not the p-value. It seems -stcox- does not return the overall p-value in e(), so I don't believe it is possible to get it into the -esttab- output. At least I don't know how.

          I suspect the reason that the model p-value is not returned in e() is because it is seldom, if ever, of real interest. I see, in your case, there are only 2 model df, so with that few variables, perhaps that is of more interest than it would usually be. I would also note, however, that your N is only 11, and maximum likelihood estimation is asymptotically correct in large samples. And with N = 11 and 2 predictors, you barely have 5 observations per predictor, which means your model is probably overfit to the noise in the data. So I'm not sure that that p-value would mean much even if you could somehow extract it.
          Hi Clyde,

          I see. I will keep the chi-square statistic for now. Thank you so much for your detailed explanation of what happened in my current model. It really helps a lot!

          Best wishes
          Meng

          Comment

          Working...
          X