Announcement

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

  • marhis command: Margins plot with Histogram for Continuous by Categorical Interaction in Linear Regression

    Dear Forum Members,

    I have estimated a linear regression model with an interaction term that involves the product of a continuous and categorical variable. The interaction term is given below.

    Code:
    c.Violence_Exposure_Index##i.Gender
    Violence exposure index is a continuous variable which is created by combining and standardizing responses to three survey questions used to build this variable. It varies between -2 and 1.5. While gender is a categorical variable with 0 'female' and 1 'male'. For marginal effects plot, I am using the Marhis command which allows the following specification after the regress command:

    Code:
    marhis Violence_Exposure_Index, cate(Gender)
    This code plots the average adjusted predictions of the categorical variable across the range of the continuous variable. However, I wish to plot the other way around.

    Specifically, I wish to plot the average adjusted predictions of the continuous variable (Violence Exposure) of the interaction term across the range of the categorical variable (Gender). Can this be accomplished using the marhis command? If yes, how would the above code needs to be written?

    Thank you.
Working...
X