Announcement

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

  • Reset test

    hi,,I'm new to using STATA I have a problem when I want to do a RESET test on a gravity model regression with PPML
    I used the following command:
    ppml ekspor PAIR_FE* year_* ln_yi ln_yj ln_rem_exp ln_rem_imp fta1 fta2 fta3
    predict fit, xb
    gen fit2=fit^2
    test fit2=0

    But the result shows that :
    fit2 is not found
    r(111);

    can someone explain what i missed or what i did wrong? fyi, I used 3 dummy variables of FTA and the best effect are using country-pair and year effect
    Thx
    Last edited by sony vebiyanto; 20 Mar 2022, 09:18.

  • #2
    Please see FAQ Section 12 on how to ask a question.

    Comment


    • #3
      Sony:
      welocme to this forum.
      As an aside to Jared's wise recommendation, you cannot invoke a -posyestimation- commnd, such as -test-, without a previous estimate.
      See the following toy-example on -regress-:
      Code:
      . use "C:\Program Files\Stata17\ado\base\a\auto.dta"
      (1978 automobile data)
      
      . regress price i.foreign
      
            Source |       SS           df       MS      Number of obs   =        74
      -------------+----------------------------------   F(1, 72)        =      0.17
             Model |  1507382.66         1  1507382.66   Prob > F        =    0.6802
          Residual |   633558013        72  8799416.85   R-squared       =    0.0024
      -------------+----------------------------------   Adj R-squared   =   -0.0115
             Total |   635065396        73  8699525.97   Root MSE        =    2966.4
      
      ------------------------------------------------------------------------------
             price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
      -------------+----------------------------------------------------------------
           foreign |
          Foreign  |   312.2587   754.4488     0.41   0.680    -1191.708    1816.225
             _cons |   6072.423    411.363    14.76   0.000     5252.386     6892.46
      ------------------------------------------------------------------------------
      
      . predict fitted, xb
      
      . g sq_fitted=fitted^2
      
      . test sq_fitted=0
      sq_fitted not found
      r(111);
      
      . regress price fitted sq_fitted
      note: fitted omitted because of collinearity.
      
            Source |       SS           df       MS      Number of obs   =        74
      -------------+----------------------------------   F(1, 72)        =      0.17
             Model |  1507382.66         1  1507382.66   Prob > F        =    0.6802
          Residual |   633558013        72  8799416.85   R-squared       =    0.0024
      -------------+----------------------------------   Adj R-squared   =   -0.0115
             Total |   635065396        73  8699525.97   Root MSE        =    2966.4
      
      ------------------------------------------------------------------------------
             price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
      -------------+----------------------------------------------------------------
            fitted |          0  (omitted)
         sq_fitted |   .0000803    .000194     0.41   0.680    -.0003064    .0004669
             _cons |    3112.32   7384.262     0.42   0.675    -11607.94    17832.58
      ------------------------------------------------------------------------------
      
      . test sq_fitted=0
      
       ( 1)  sq_fitted = 0
      
             F(  1,    72) =    0.17
                  Prob > F =    0.6802
      
      .
      Kind regards,
      Carlo
      (StataNow 18.5)

      Comment


      • #4
        Mr. Carlo Lazarro
        Thx for your response

        It works,, although the results are not as desired because they did not pass the Ramsey test

        Comment


        • #5
          Sony:
          check whether your model has all the predictors and/or interactions plugged in.
          Kind regards,
          Carlo
          (StataNow 18.5)

          Comment

          Working...
          X