Announcement

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

  • PPML,fixed effect

    Hello, statalist,

    I am master student and writing thesis now.

    I will use Gravity PPML with fixed effect, but now I'm very confused.

    my data is 7 years 180 country, 10000 trade panel data

    My variables are

    log_value log_dis_ij language log_rem_i log_rem_j log_gdp_i log_gdp_j

    log_value = import value
    log_dis_ij = distance between i, j
    language = dummy variable , language difference
    log_rem_i = remoteness ,i
    log_rem_j = remoteness, j
    log_gdp_i = gdp ,i
    log_gdp_j= gdp,j


    I hope to add country, year fixed effect , but Im very confused how to deal with it.

    I read papers that I should drop gdp variables (if I add country fixed effect , year fixed effect)


    I don't know which one should I use between
    time-varing fixed effect or country pair fixed effect.

    also

    I wonder MTR (remoteness) must be dropped with GDP


    Could you give me any commend?

    thank you so much in advance


  • #2
    egen it=group(i year)

    egen ij=group(j year)

    xtset year
    ppml log_value log_dis_ij ban regionalization language i.it i.ij i.year

    I tried this command and I got
    'factor variables and time-series operators not allowed'

    anyone know how to fix it?

    Thank you

    Comment


    • #3
      Hi there,

      The first thing to note is that with PPML the dependent variable should not be in logs. Also, the -ppml- command does not allow the use of factor variables. I recommend that you create the dummies before running the command, and then include them in the model.

      Best wishes,

      Joao

      Comment


      • #4
        Thnak you so much!

        I fixed command,


        so it;s
        egen it=group(i year)
        egen jt=group(j year)
        tab year,gen(year_dum)
        tab it,gen(it_dum)
        tab jt,gen(jt_dum)
        xtset year
        ppml value dis_ij ban regionalization language it_dum* year_dum* jt_dum*



        but I also got this massage
        'note: checking the existence of the estimates
        matsize too small
        You have attempted to create a matrix with too many rows or columns or attempted to
        fit a model with too many variables. You need to increase matsize; it is currently
        400. Use set matsize; see help matsize.

        If you are using factor variables and included an interaction that has lots of missing
        cells, either increase matsize or set emptycells drop to reduce the required matrix
        size; see help set emptycells.

        If you are using factor variables, you might have accidentally treated a continuous
        variable as a categorical, resulting in lots of categories. Use the c. operator on
        such variables.'




        Comment


        • #5
          As the message says, you need to change the matsize; alternatively use xtpoisson with the FE option.

          Best wishes,

          Joao

          Comment


          • #6
            Thank you so much!


            Best regards

            Comment

            Working...
            X