Announcement

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

  • 3-way interaction

    Hi everyone,

    I am currently working on a multiple linear regression model and need to include a three-way interaction. I want to make sure I am specifying and interpreting it correctly in Stata, as this specific constellation is giving me some trouble.

    Here is the setup of my variables:
    • gender: Categorical (0 = Male, 1 = Female)
    • jogging: Continuous/Metric (Measured on a 1 to 7 scale)
    • reading: Continuous/Metric (Measured on a 1 to 7 scale)
    • Y: Continuous dependent variable

    I want to test if the two-way interaction between the two hobbies (jogging and reading) on Y differs by gender.

    Currently, my regression code looks like this: regress Y i.gender##c.jogging##c.reading

    Is it generally possible to model it this way?

    Can anyone recommend methodological papers, textbooks, or articles that explicitly discuss three-way interactions involving one categorical and two continuous variables? Most literature I find focuses either on three categorical variables, or two categorical and one continuous variable.

    Thank you.

  • #2
    Your specification for a regression model with the 3-way interaction you describe is correct. Stata will fill in all individual and two-way interaction predictors with this notation.

    I am not aware of any literature you are specifically asking about, but I think you are overthinking things. If you understant two-way interactions with any mix of continuous/categorical variables, a three-way interaction is just one more variable to add to this mix. In that sense, it is not different or special compared to other three-way interactions (modulo the variable metric of continous or categorical). It may be useful for direct interpretation of coefficient to center each of these variables to some meaningful value. (Note: In some cases, centering is required to aid model fit.)

    You mention that jogging and reading are measured on a 7-point scale, so you may be better off to model these are categorical variables instead of making the assumption that they are interval.

    if you wanted to actually test the three-way interaction, one way to do that is to use

    Code:
    test i.gender#c.jogging#c.running
    But if you want to know whether the association of either jogging or running on Y differ by gender, this would need to consider all two-way or higher terms which include gender.

    Code:
    testparm i.gender#c.jogging#c.reading i.gender#c.(jogging reading)

    Comment


    • #3
      Another way to think about this is to visualize a two-way interaction over levels of a third variable with a plot of the model predictions (using predict or margins). A visualization of a three-way interaction can mean that the shape of the two-way interaction is not constant over levels of the third variable. If categorical, visualize at each level. If continuous, visualize at the mean and +/- 1 SD, for example.

      Comment


      • #4
        Originally posted by Beate Schmidt View Post
        Hi everyone,

        I want to test if the two-way interaction between the two hobbies (jogging and reading) on Y differs by gender.

        Thank you.
        Because your categorical variable (gender) has just two levels, the numerator df for your 3-way interaction term = 1. Therefore, the t-test on the 3-way interaction is the test you ask for. The null hypothesis it tests can be stated in any of the following ways (with J=jogging, R=reading, G=gender):
        • The nature of the J#R interaction does not depend on G
        • The nature of the J#G interaction does not depend on R
        • The nature of the R#G interaction does not depend on J.
        The first one describes the test you want.

        If you reject the null hypothesis, one option would be to follow up with a contrast command like this:

        Code:
        contrast c.J#c.R@G
        This will give you tests of the J#R interaction for each gender separately.

        I hope this helps.
        --
        Bruce Weaver
        Email: [email protected]
        Version: Stata/MP 19.5 (Windows)

        Comment

        Working...
        X