Announcement

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

  • Regression fitting ionteractions at specific categorical levels only?

    In a regression model, specifically an stcox model, is there a way to fit an interaction between two categorical variables at only the categorical levels where the interaction is significant?

    If I test for significant interactions between my variables, I find that that there is a significant interaction between dose at the highest dose (dose==4) and age at enrolment at the older age group (agegrp==5), at every other level the P>|z| > 0.3.

    I currently have the code set up to include the main effect and the interaction effect,
    HTML Code:
     stcox sex agegrp treat dose dose#agegrp
    but this estimates the hazard ration between every other level, is there a way to limit the interaction only to agegrp==5#dose==4?

  • #2
    You could create new variables that are dichotomous, one for agegrp == 5 and the other for dose == 4, and then do the Cox regression again using those two variables and their interaction instead of agegrp and dose.

    That said, I wouldn't do this at all. Revising regressions to include only the variables that meet a statistical significance criterion is a minor variant of stepwise regression, and the major problems with the latter procedure are well known. (See https://www.stata.com/support/faqs/s...sion-problems/ for a brief summary in the context of linear regression, but most of them also apply to any kind of statistical analysis.) There is an additional consideration specifically relating to interactions: unless your study's a priori sample size determination was based on having adequate power to detect fine-grained interactions like these, most studies are, in real life, seriously underpowered for this purpose because they require much larger sample sizes than are simply adequate to detect main effects. In the presence of low power, the non-significance of some interaction terms loses its meaning altogether, and, less widely understood, selecting those that are statistically significant has the effect of introducing a bias towards results that are exaggerated in magnitude compared to reality, and also have an increased probability of being in the wrong direction!

    Comment


    • #3
      Originally posted by Clyde Schechter View Post
      You could create new variables that are dichotomous, one for agegrp == 5 and the other for dose == 4, and then do the Cox regression again using those two variables and their interaction instead of agegrp and dose.

      That said, I wouldn't do this at all. Revising regressions to include only the variables that meet a statistical significance criterion is a minor variant of stepwise regression, and the major problems with the latter procedure are well known. (See https://www.stata.com/support/faqs/s...sion-problems/ for a brief summary in the context of linear regression, but most of them also apply to any kind of statistical analysis.) There is an additional consideration specifically relating to interactions: unless your study's a priori sample size determination was based on having adequate power to detect fine-grained interactions like these, most studies are, in real life, seriously underpowered for this purpose because they require much larger sample sizes than are simply adequate to detect main effects. In the presence of low power, the non-significance of some interaction terms loses its meaning altogether, and, less widely understood, selecting those that are statistically significant has the effect of introducing a bias towards results that are exaggerated in magnitude compared to reality, and also have an increased probability of being in the wrong direction!
      Interesting, thank you for the insight. In this case I would prefer to keep the full interaction within the model.

      With that in mind, once I know that I would like to include a covariate/interaction in the model, is there a way to exclude the regression results from the output window of certain variables. As is running the interactions -quietly- in future regressions?

      Comment


      • #4
        No, the regression output includes all variables in the model except for base categories and variables omitted due to colinearity. (Actually, even those are there, but they are marked as such and there are no coefficients or other statistics.) You can run the entire regression -quietly-, but then you get no output table at all. You cannot apply -quietly- to selected variables in the regression.

        What you can do is launder the regression results through a pretty-print program that has a -keep()- or -drop()- option that lets you specify whatever subset of the results interest you most for presentation. There are several such programs. Among those that come to mind are the official Stata -etable- command, and Ben Jann's -estout- and -esttab-, which, if memory serves, are available from SSC. Consult the help files for these programs for details of the syntax.

        Comment

        Working...
        X