Announcement

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

  • How to create interaction variable in stata

    I have 2 independent variables and i need to create an interaction from both variable.
    The first variable is distance to financial institution and i made the data became categorical (1: 0-1km; 2: 1-10km; 3: >10km)
    The second variable is health shock in the dummy form. 1 for health shock occur, and 0 for health shock doesnt occur.
    My data is panel for year 2007 and 2014.
    Can i make an interaction from both variable? If yes, how can i do that?
    Last edited by Ainun Nisa; 27 Apr 2020, 22:25.

  • #2
    Airun:
    yes, you can (see -fvvarlist- for more details):
    Code:
     xtset panelid year
    xtreg <depvar> <otherpredictors> i.distance##i.shock <controlsifany>
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you very much for your help. Finally i can finish my analysis for this topic

      Comment

      Working...
      X