Announcement

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

  • 2SLS with linear time trend.

    Hi all,

    I am estimating the following model using fixed effects including linear time trends.

    Code:
    xtreg lemp lunion lunemployment lfertility lyouth i.year i.id##c.year, fe vce(cluster id)
    Due to concerns the fertility may be endogenous, I am also using 2SLS, and the following code.

    Code:
    xtivreg lemp lunion lunemployment lyouth i.year (lfertility = lagfertility), fe vce(cluster id)

    When I try to include the linear time trend i.id##c.year the following message is displayed:

    Code:
    independent variables are collinear with the panel variable id
    My question is, is it possible to include linear time trends with instrumental variable estimation?





  • #2
    The time-trend is the year variable, not sure why you would want to interact it with the panel dummies. Remember in a panel, year is repeated for each cross-sectional unit.

    Code:
    xtivreg lemp lunion lunemployment lyouth i.year year (lfertility = lagfertility), fe vce(cluster id)

    Comment


    • #3
      Sorry, I didn't specifiy, I am including country-specific linear time trends, hence the interaction terms.

      I am unsure whether this inclusion is compatible with 2SLS estimation however.
      Last edited by Jane Wilson; 04 Mar 2019, 08:19.

      Comment


      • #4
        For each country, the panel identifier is constant over time. So the variable that you want to create will be perfectly positively correlated with your panel identifier. In statistical terms, it is the same variable - so you are just expressing the panel variable in a different way.

        Code:
        gen idyear= id*year
        corr id idyear
        Last edited by Andrew Musau; 04 Mar 2019, 09:16.

        Comment


        • #5
          Hi Andrew,

          Thank you for your help so far.

          I was under the impression that
          Code:
           i.id##c.year
          would generate country-specific linear time trends.

          When I include this interaction with a fixed effects regression I get out complete results. I am confused as to why this doesn't work in the same with with xtivreg.

          Comment


          • #6
            My apologies Jane, the interactions create a series of variables, not a single variable as id is a categorical variable. The reason you get the error is that you are including i.id among the regressors, as i.id##c.year = i.id + i.id#c.year + c.year. You don't need the first term, so just restate your syntax as follows:


            Code:
            xtivreg lemp lunion lunemployment lyouth i.year i.id#c.year year (lfertility = lagfertility), fe vce(cluster id)

            Comment


            • #7
              Thank you for all your help Andrew!

              Comment

              Working...
              X