Announcement

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

  • Country-specific linear trends

    Hi

    I am trying to estimate the equation using reghdfe.

    I have to add the country-specific linear trends. how I can generate these and add to the equations please

    Thanks

  • #2
    Hello

    is this the right approach please


    * Example data
    use your_data

    * Create dummy variables for each country
    tabulate country, generate(country_dummies)

    * Create time trend variable
    gen time_trend = year - 2000

    * Create country-specific time trend variables
    foreach c of varlist country_dummies* {
    foreach y of varlist time_trend {
    gen `c'_`y' = `c'*`y'
    }
    }

    * Estimate fixed-effects regression with country-specific time trends using reghdfe
    reghdfe dependent_var `c'_time_trend* independent_vars, absorb(country) vce(cluster id)

    Comment


    • #3
      Well, yes, you could do it that way, but it's way more complicated than you need. All you need to do is:
      Code:
      reghdfe dependent_var i.country#c.year independent_vars, absorb(country) vce(cluster id)
      See -help fvvarlist-.
      Last edited by Clyde Schechter; 20 Mar 2023, 15:30.

      Comment


      • #4
        Originally posted by Clyde Schechter View Post
        Well, yes, you could do it that way, but it's way more complicated than you need. All you need to do is:
        Code:
        reghdfe dependent_var i.country#c.year independent_vars, absorb(country) vce(cluster id)
        See -help fvvarlist-.
        Thanks


        I have to include the linear time trends for each grid point in the data. how I can do this please

        Comment


        • #5
          What do you mean by "grid point?"

          And I think it is (past) time for you to show example data here.

          Comment

          Working...
          X