Announcement

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

  • Determining the turning point for the interaction effect of two dummy variables in Cox survival analysis

    Dear Stata-community,

    I am applying Cox survival analysis to a large dataset on new ventures and private investors. I have two dummy variables representing the celebrity status of the startup and the investor. When multiplying them in the regression, the direct effects are very high and significant (hazard ratios way above 1). However, the interaction effect is negative (below 1) and also significant.

    I know would like to calculate (or see) if the interaction effect just reduces the strong positive effect of the direct effects or if it actually turns the direct effects negative.

    For linear and probit regressions, I am aware of the marginsplot command, however, this one is not usable for Cox analysis. Also the mcp command does not really help me with that - first of all because I have dummy variables and second, because it does not show appropriately the confidence intervals.

    Thus, I would be very grateful if you could help me with a formula or whatever command to reveal the true effect of the interaction.

    Here are the results:

    Click image for larger version

Name:	Bildschirmfoto 2017-03-29 um 18.07.09.png
Views:	1
Size:	30.6 KB
ID:	1380903



    Thank you a lot!

    Best,
    Rike

  • #2
    You may wish to use - margins - as well as - marginsplot - command.
    Best regards,

    Marcos

    Comment


    • #3
      Rike:
      - as per MArcos' helpful reply, -stcox postestimation- includes -margins- as well as -marginsplot-;
      - usually, investigating the existence of a turning point implies including in the right-hand side of your regression equation the same predictor in linear and squared form;
      -about interactions: you would be better off with creating categorical variables and interactions via -fvvarlist-.
      In your case, the code becomes:
      Code:
      stcox <depvar> i.anyBAcelebrity##i.anystartupcelebrityattention <otherindepvars>
      That way, Stata recognizes that you have interacted two predictors; conversely, if you ceate the interaction by hand, Stata considers the interatction and the predictors included in the interaction like different stuff and, more substantively, deny you access to -margins- and -marginsplot- capabilities.

      As a closing-out remark, please note that your chances of getting (more) helpful replies are conditional on posting exactly what you typed and what Stata gave you back (as per FAQ). Thanks.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Dear both,

        thank you a lot for your insightful remarks - especially @Carlo, I absolutely ignored to use the i.variable notation (I still used c. because I have other continuous variables in my model).

        I applied all margins and marginsplot command, however, I feel that there is something wrong with the results. I can see it in the screenshots attached. How can it be, that the different effects are not significant given that the other variables are calculated at their means (if I remember correctly). This strikes me since the coefficients are significant in in the models. Also when looking at the marginsplot, I would assume that the interactive effect reduced the strong positive direct effects of the two dummy variables, thus, there is no turning point. However, the confidence intervals suggest again that this is not significant. I recall that I read somewhere in a statistical paper that it does actually not make sense to use margins after the cox command as the way margins are calculated does not appropriately apply in this case. I believe there is some truth in it as I never see the margins provided in papers with survival analysis.

        Click image for larger version

Name:	Bildschirmfoto 2017-03-31 um 09.03.32.png
Views:	1
Size:	43.2 KB
ID:	1381243

        Click image for larger version

Name:	Bildschirmfoto 2017-03-31 um 09.04.24.png
Views:	1
Size:	85.0 KB
ID:	1381244


        I am confused :-(.

        Here is the code I am using

        Code:
        stcox i.celebrity_attention##i.celebrity_attention_comp celebrity_inv_75_cum_BA celebrity_per_75_cum_BA company_age founder_team_total affiliates_prior_founder_exp patent_app_comp b2c investment_exp_all_BA founder_exp_company_total amount_first_funding_ln syndicate_size_first_funding i.region_an i.industry_class i.first_funding_year, robust nolog

        Thanks a lot for clarifying this for me! (And yes, I have already consulted more experienced Stata-user at my home university, but no one could really help me with that).

        Best,
        Rike

        Comment


        • #5
          Rike:
          the "weird" results you're facing may be due to the different role of -predict- and -margins- in survival analysis.
          That issue is well covered in http://www.stata.com/bookstore/survi...-introduction/, pages 302-315.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment

          Working...
          X