Announcement

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

  • Omnibus interaction tests with survey data

    Hello Statalist,

    I am trying to figure out why I am getting different p-values when using two different omnibus or global interaction tests with survey data. I am using a restricted dataset and so cannot post my output here, but here is my code and summary of results. I am using Stata 16.1 on Windows 10 Pro.

    Code:
     svy: glm pos i.newsexid##i.gendersex i.covid i.race i. educ, fam(poisson) link(log) eform
    The variables I am interacting each have 4 levels coded as 0,1,2,3 with 0 being the referent group. The output shows a p-value less than 0.05 for the interaction between two of the category combinations only (bisexual#transgender, for example). But what I want is an overall/omnibus/global interaction test for ease of reporting. My first approach to testing the global interaction is below.

    Code:
     testparm i.newsexid#i.gendersex2
    This gives me a p-value of 0.01

    The following is my second approach, which gives a p-value for the 'intterm' of 0.2.

    Code:
     gen intterm=newsexid*gendersex2
    svy: glm pos i.newsexid intterm i.gendersex i.covid i.race i. educ, fam(poisson) link(log) eform


  • #2
    The variables I am interacting each have 4 levels coded as 0,1,2,3 with 0 being the referent group.
    In that case, -gen intterm=newsexid*gendersex2- is not a correct specification of the interaction between them. Rather there is no single interaction term. There are (4-1)*(4-1) = 9 interaction terms, and there is no way to contain them in a single variable.

    Your first approach is correct. Your second approach is invalid.

    Added: More generally, you can represent an interaction as a single variable equal to the product of the two variables if the variables involved are either continuous, or dichotomous. But it is not possible if either variable is polytomous, as here.
    Last edited by Clyde Schechter; 19 Sep 2022, 10:27.

    Comment

    Working...
    X