Announcement

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

  • Panel data and regressing when the occurrence of a dummy variable may affect other occurrences

    Hello all,

    I am looking into how the number of times a person migrates affects their change in happiness levels by using panel data and with the plan to use fixed effect regression.

    In my econometric model, I have dummy variables that show when an individual moves and how many times they have moved up to that point (dummy variables are as follows, ‘5th time of migration’, ‘6th time of migration'…nth time of move). It has come to my awareness that with the increasing occurrence of migration, that prior migrations may impact the effectiveness of the nth time of migration.

    My question Is if there is a way to take this into account? I know about interaction variables, but the model currently has 11 dummy variables to show each time a person moves. Would the creation of a categorical variable to encompass all the dummy variables be needed but how to consider if prior moves affect the current move?

    I am using Stata 15.

    This is a continuation of the post from https://www.statalist.org/forums/for...dummy-variable.

    Thank you in advance.

  • #2
    Since you allow different effects for the number of previous moves, I would think that those parameters would incorporate any effects of prior moves by that specific person.

    When you say increasing occurrence of migration, are you saying it may change over time? You could interact year with the dummies:
    xtreg y c.year i.x c.year#i.x

    Or, you could set up a dummy for early and late and interact that with the dummies.

    Comment


    • #3
      Hello,

      This might clear up what I am trying to say.

      I first did this to find out how many times an individual migrated
      Code:
      by pid (wave), sort: gen number_of_migrations = sum(M0)
      (wave is time, pid is the identification of the individual, M0 is if they migrate in that wave)

      I then created dummy variables using this process:
      Code:
      gen byte m1 = 0
      then
      Code:
      replace m1 = 1 if M0 == 1 & number_of_migrations == 1
      replace m2 = 1 if M0 == 1 & number_of_migrations == 2
      [this was repeated for each time of migration [my data had a maximum of 11 migrations]]

      My trouble is that migration affects happiness years prior to migration, including the wave of migrations, I wasn't too sure on the best way to find the relationship between happiness and how it is affected each time an individual migrates.

      Option 1:
      To do a fixed effects regression with each dummy variable of the nth time of migration and ignore the prior effect of migration on happiness.
      Option 2:
      To do a fixed effects regression with each dummy variable of the nth time of migration with leads i.e
      F3.m1 F2.m1 F1.m1 m1 F3.m2 etc.
      Option3:
      To do a fixed effects regression but have the nth time of migration as a categorical variable that includes the leads as values within:
      Process (example using 1st time of migration and 2nd time of migration)
      i. Creating the leads
      Code:
      forval j = 1/5 {
                        cap drop lead'j'
                          gen move_one_lead'j' = F'j'.m1
                          gen move_two_lead'j' = F'j'.m2     
                   }
      ii. Creating categorical variables
      iii. Regression
      xtreg y i.first_move i.second _move, fe
      For option two and three, as repeated migration happens, each wave can have multiple values associated with them (i.e in one wave it is possible to have m1 = 1, F1.m2 = 1 and also F2.m3 = 1 (migration in 3 successive waves for an individual)). Is this an issue?



      Comment

      Working...
      X