Announcement

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

  • Dear, PPML fixed effect (country , time)

    Dear statalist,

    I hope to run regress panel data using PPML method with country effect(dummy), time effect( dummy)
    200import, export countries, 7 years

    I have these variables,
    log_value importcountry_i exportcountry_j log_distance_ij language log_rem_i log_rem_j log_gdp_i log_gdp_j

    I am very beginner, so I do not know how to command for PPML with fixed dummy variables.

    dependent variable is log_vlaue,

    1. I want to make country , time dummy effect as fixed effect.

    When I command, 'xtset year importcountry exportcounty' --> there is sign ' too many variables'

    2. I hope to know command for PPML

    3. I wonder why I don't need GDP variable if I use fixed dummy effect


    Thank you so much statalist

    Sincerely

  • #2
    Kim:
    Double posted at https://www.statalist.org/forums/for...d-effect-dummy.
    Your previous query did not get any reply probably because it was too vague: you cannot expect any teaching note from interested listers! (please, see the FAQ on how to post more effectively).
    That said, there's at least a trivial error in you -xtset- attempt: -xtset- requires a -panelid- (mandatory) and a time variable (optional) (see -xtset- entry for more on that topic).
    Hence, your:
    Code:
    xtset year importcountry exportcounty
    legally gave back an error message.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you ,I will fix it~

      Thank you for ur reply!
      Last edited by KIM SUJIN; 30 Aug 2017, 04:21.

      Comment


      • #4
        Dear,
        I tried to make dummy variables with xi command.
        I got this result!

        command:
        xi log_value log_dis_ij ban regionalization language log_rem_i log_rem_j log_gdp_i log_gdp_j i.i i.j

        result:
        i.i _Ii_1-138 (_Ii_1 for i==Albania omitted)
        i.j _Ij_1-144 (_Ij_1 for j==Albania omitted)


        dependent variable : log _vlaue
        independent variable : log_dis_ij, ban, regionalization, language, log_rem_i, log_rem_j, log_gdp_i, log_gdp_j


        Could anyone give me any advice why ij_1 is omitted??

        Thank you so much in advance!!

        Best regards,

        Comment


        • #5
          Kim:
          as per your previous post, I assume that your goal was to carry out a panel data regression (although your code is not informative in that respect).
          Without seeing an example/excerpt of your data (that you can post via -dataex-; type -search dataex- from within Stata to install it), it is hard to explain why -Albania- was omitted: an educated guess may consider collinearity with the -panelid- included in -xtset-.
          As an aside, if you're using a pretty recent Stata release, you can (almost always) leave the old-fashioned, redundant -xi- prefix in favour of the smarter -fvvarlist- notation for creating both categorical and interactions.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Thank you so much!
            I will try!!

            Comment


            • #7
              Dear
              I am keep going with it, and I hope to put ' i, j ,year 'as a fixed effect!
              I have stata 14

              code:
              xtpoisson log_value log_dis_ij ban regionalization language log_rem_i log_rem_j log_gdp_i log_gdp_j i_dum* j_dum* year_dum*,fe vce(robust)


              I wonder how to put only i, j, year as a fixed effect!

              Anyone have any comment??

              Thank you so much!!

              Comment


              • #8
                Kim:
                I fail to get what you'after.
                What are i, j, year?
                Is your dataset already in -long- format?
                Did you take a look at -help fvvarlist-?
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9

                  yes! thank you

                  I run regress PPML with xtpoisson!
                  I made dummy variables , and I hope to put dummy as a independent variables

                  so it was
                  code:
                  xtpoisson log_value log_dis_ij ban regionalization language log_rem_i log_rem_j log_gdp_i log_gdp_j i_dum* j_dum* year_dum*,fe vce(robust)


                  i : import country
                  j : export country


                  year is panel data time period (7years)

                  Comment


                  • #10
                    Kim:
                    thanks for providing further details.
                    However, the main issue remains the same: why creating categorical variables yourself when -fvvarlist- can do it exceptionally well for you?
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #11
                      Oh, I will check it once again !
                      To be honest, I'm begginer., so I didnt really understand - help fvvarlist- contents... haha;;
                      Last edited by KIM SUJIN; 02 Sep 2017, 03:05.

                      Comment


                      • #12
                        Kim:
                        being a beginner (as Nick Cox wrote in one of his post on this list some years ago, obviously in an English better tha mine: "We are all beginners. Some of us are only more experienced") is not a sound justification for skipping the building blocks of Stata language.
                        Gaining familiarity with -fvvarlist- (as with most of the things in life) requires devoting some hours of your time.
                        Look at the following toy-example and see the usefulness of -fvvarlist- (when contrasted against creating categorical variables and interactions by hand):
                        Code:
                        . sysuse auto.dta
                        (1978 Automobile Data)
                        
                        . regress price i.rep78 i.foreign
                        
                              Source |       SS           df       MS      Number of obs   =        69
                        -------------+----------------------------------   F(5, 63)        =      0.19
                               Model |  8372481.37         5  1674496.27   Prob > F        =    0.9670
                            Residual |   568424478        63  9022610.75   R-squared       =    0.0145
                        -------------+----------------------------------   Adj R-squared   =   -0.0637
                               Total |   576796959        68  8482308.22   Root MSE        =    3003.8
                        
                        ------------------------------------------------------------------------------
                               price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                        -------------+----------------------------------------------------------------
                               rep78 |
                                  2  |   1403.125   2374.686     0.59   0.557    -3342.306    6148.556
                                  3  |   1861.058   2195.967     0.85   0.400    -2527.232    6249.347
                                  4  |   1488.621   2295.176     0.65   0.519    -3097.921    6075.164
                                  5  |   1318.426   2452.565     0.54   0.593    -3582.634    6219.485
                                     |
                             foreign |
                            Foreign  |    36.7572   1010.484     0.04   0.971    -1982.533    2056.048
                               _cons |     4564.5   2123.983     2.15   0.035     320.0579    8808.942
                        ------------------------------------------------------------------------------
                        Kind regards,
                        Carlo
                        (Stata 19.0)

                        Comment


                        • #13
                          Thank you! I changed my command

                          all of code is like this

                          :


                          egen I=group(i)
                          egen J= group(j)
                          egen IJ= group(ij)

                          xtset IJ year
                          xtpoisson log_value log_dis_ij ban regionalization language log_rem_i log_rem_j log_gdp_i log_gdp_j i.I i.J i.year, robust


                          However, I still don't get fixed effect command..


                          Thank you so much

                          Comment


                          • #14
                            Kim:
                            you should add -fe- after the comma for a (please note) conditional -fe- specification under -xtpoisson-.
                            Kind regards,
                            Carlo
                            (Stata 19.0)

                            Comment


                            • #15
                              Thank you so much for ur help Carlo Lazzaro
                              I really appreciate.

                              May I ask you last question if u don't mind~?

                              I hope to put only year , i , j as a fixed effect.
                              Do you know how to limit only year, i ,j is fixed effect?


                              Thank you in advance!

                              Comment

                              Working...
                              X