Announcement

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

  • #16
    Dear Carlo,

    Here is my result without detrending:


    Code:
    . reg log1 abs_r_mt rmt2
    
          Source |       SS           df       MS      Number of obs   =     2,418
    -------------+----------------------------------   F(2, 2415)      =    200.50
           Model |  73.7438233         2  36.8719117   Prob > F        =    0.0000
        Residual |  444.111582     2,415  .183897135   R-squared       =    0.1424
    -------------+----------------------------------   Adj R-squared   =    0.1417
           Total |  517.855405     2,417  .214255443   Root MSE        =    .42883
    
    ------------------------------------------------------------------------------
            log1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
        abs_r_mt |   .2437952   .0158073    15.42   0.000     .2127979    .2747925
            rmt2 |  -.0220551   .0027192    -8.11   0.000    -.0273873   -.0167229
           _cons |   .1940486   .0152521    12.72   0.000       .16414    .2239573
    ------------------------------------------------------------------------------
    
    . estat ovtest
    
    Ramsey RESET test using powers of the fitted values of log1
           Ho:  model has no omitted variables
                    F(3, 2412) =      5.06
                      Prob > F =      0.0017
    
    . estat hettest
    
    Breusch-Pagan / Cook-Weisberg test for heteroskedasticity 
             Ho: Constant variance
             Variables: fitted values of log1
    
             chi2(1)      =     2.13
             Prob > chi2  =   0.1441
    After detrending:

    Code:
    . gen year=year(date)
    
    . reg log1 abs_r_mt rmt2 i.year
    
          Source |       SS           df       MS      Number of obs   =     2,418
    -------------+----------------------------------   F(11, 2406)     =    190.18
           Model |  240.853716        11  21.8957924   Prob > F        =    0.0000
        Residual |  277.001688     2,406  .115129546   R-squared       =    0.4651
    -------------+----------------------------------   Adj R-squared   =    0.4627
           Total |  517.855405     2,417  .214255443   Root MSE        =    .33931
    
    ------------------------------------------------------------------------------
            log1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
        abs_r_mt |   .1538489   .0128074    12.01   0.000     .1287342    .1789636
            rmt2 |  -.0159789   .0021665    -7.38   0.000    -.0202274   -.0117305
                 |
            year |
           2002  |  -.2130969   .0310801    -6.86   0.000    -.2740435   -.1521503
           2003  |  -.0671241   .0309481    -2.17   0.030    -.1278118   -.0064363
           2004  |   .0917492   .0309159     2.97   0.003     .0311246    .1523739
           2005  |   .2934731   .0309407     9.49   0.000        .2328    .3541463
           2006  |   .3938697     .03096    12.72   0.000     .3331586    .4545808
           2007  |     .67599   .0313941    21.53   0.000     .6144277    .7375523
           2008  |   .6037664   .0316981    19.05   0.000      .541608    .6659249
           2009  |   .3832097    .031109    12.32   0.000     .3222066    .4442129
           2010  |   .2179331   .0309532     7.04   0.000     .1572354    .2786308
                 |
           _cons |   .0458146   .0234033     1.96   0.050    -.0000781    .0917073
    ------------------------------------------------------------------------------
    
    . estat ovtest
    
    Ramsey RESET test using powers of the fitted values of log1
           Ho:  model has no omitted variables
                    F(3, 2403) =      3.18
                      Prob > F =      0.0230
    
    . estat hettest
    
    Breusch-Pagan / Cook-Weisberg test for heteroskedasticity 
             Ho: Constant variance
             Variables: fitted values of log1
    
             chi2(1)      =     3.40
             Prob > chi2  =   0.0652
    
    .
    Out of curiosity, I also ran the regression with robust SE,

    Code:
    .  reg log1 abs_r_mt rmt2 i.year, robust
    
    Linear regression                               Number of obs     =      2,418
                                                    F(11, 2406)       =     186.33
                                                    Prob > F          =     0.0000
                                                    R-squared         =     0.4651
                                                    Root MSE          =     .33931
    
    ------------------------------------------------------------------------------
                 |               Robust
            log1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
        abs_r_mt |   .1538489   .0151115    10.18   0.000      .124216    .1834818
            rmt2 |  -.0159789   .0030179    -5.29   0.000    -.0218968   -.0100611
                 |
            year |
           2002  |  -.2130969   .0325236    -6.55   0.000     -.276874   -.1493198
           2003  |  -.0671241   .0322656    -2.08   0.038    -.1303952   -.0038529
           2004  |   .0917492   .0288353     3.18   0.001     .0352047    .1482937
           2005  |   .2934731   .0324003     9.06   0.000     .2299377    .3570086
           2006  |   .3938697   .0302312    13.03   0.000     .3345879    .4531515
           2007  |     .67599   .0304858    22.17   0.000     .6162088    .7357712
           2008  |   .6037664   .0305015    19.79   0.000     .5439545    .6635784
           2009  |   .3832097   .0299544    12.79   0.000     .3244707    .4419487
           2010  |   .2179331   .0302593     7.20   0.000     .1585962      .27727
                 |
           _cons |   .0458146   .0234242     1.96   0.051     -.000119    .0917482
    ------------------------------------------------------------------------------
    
    . estat ovtest
    
    Ramsey RESET test using powers of the fitted values of log1
           Ho:  model has no omitted variables
                    F(3, 2403) =      3.18
                      Prob > F =      0.0230
    Do note that the coefficient of rmt2 is my estimate of interest, and I noticed that the t-stat of it keeps getting smaller, from -8 to -7 to -5 eventually, might it be a problem?

    Comment


    • #17
      Guest:
      log-linear model seems to solve heteroskedasticity, but the main issue with your data is that you still have specification problem (as per RESET output).
      You may try to plug in both the linear and the squared terms for -rmt- via -fvvarlist- notation.
      Nothing relevant is happening with -rmt2- coefficient: no need to worry about that.
      Last edited by sladmin; 09 Apr 2018, 08:59. Reason: anonymize poster
      Kind regards,
      Carlo
      (Stata 18.0 SE)

      Comment


      • #18
        Dear Carlo,

        -fvvarlist- notations were used in my initial regression, I was trying to make it more understandable by using more approachable notations (or so I thought I was), so sorry for confusing you. I will replicate my result using my original notations.

        Code:
        . gen log1 = log(csad)
        (192 missing values generated)
        
        . gen year=year(date)
        
        . regress csad c.abs_r_mt##c.abs_r_mt
        
              Source |       SS           df       MS      Number of obs   =     2,609
        -------------+----------------------------------   F(2, 2606)      =    369.70
               Model |  491.324057         2  245.662028   Prob > F        =    0.0000
            Residual |  1731.65225     2,606  .664486665   R-squared       =    0.2210
        -------------+----------------------------------   Adj R-squared   =    0.2204
               Total |  2222.97631     2,608  .852368215   Root MSE        =    .81516
        
        ------------------------------------------------------------------------------
                csad |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
            abs_r_mt |   .6120725    .028192    21.71   0.000     .5567915    .6673534
                     |
          c.abs_r_mt#|
          c.abs_r_mt |  -.0587181   .0049878   -11.77   0.000    -.0684984   -.0489377
                     |
               _cons |   1.051306   .0260192    40.41   0.000     1.000286    1.102327
        ------------------------------------------------------------------------------
        
        . regress log1 c.abs_r_mt##c.abs_r_mt
        
              Source |       SS           df       MS      Number of obs   =     2,418
        -------------+----------------------------------   F(2, 2415)      =    200.50
               Model |  73.7438233         2  36.8719116   Prob > F        =    0.0000
            Residual |  444.111582     2,415  .183897135   R-squared       =    0.1424
        -------------+----------------------------------   Adj R-squared   =    0.1417
               Total |  517.855405     2,417  .214255443   Root MSE        =    .42883
        
        ------------------------------------------------------------------------------
                log1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
            abs_r_mt |   .2437952   .0158073    15.42   0.000     .2127979    .2747925
                     |
          c.abs_r_mt#|
          c.abs_r_mt |  -.0220551   .0027192    -8.11   0.000    -.0273873   -.0167229
                     |
               _cons |   .1940486   .0152521    12.72   0.000       .16414    .2239573
        ------------------------------------------------------------------------------
        
        . estat ovtest
        
        Ramsey RESET test using powers of the fitted values of log1
               Ho:  model has no omitted variables
                        F(3, 2412) =      5.06
                          Prob > F =      0.0017
        
        . estat hettest
        
        Breusch-Pagan / Cook-Weisberg test for heteroskedasticity 
                 Ho: Constant variance
                 Variables: fitted values of log1
        
                 chi2(1)      =     2.13
                 Prob > chi2  =   0.1441
        
        .
        I have also noticed that, after I logged my DV, both the R^2 and adjusted R^2 of my regression fell, should it not be of concern to me?

        Comment


        • #19
          Guest:
          squared term makes sense in your regression.
          However, the main issue now is to collect more predictors (as RESET outcome is significant).
          The R^2 will probably increase as a result of plugging in more predictors (see the literature in your research field to get what Others did in the past when presented with the same research goal).
          Last edited by sladmin; 09 Apr 2018, 08:59. Reason: anonymize poster
          Kind regards,
          Carlo
          (Stata 18.0 SE)

          Comment


          • #20
            Dear Carlo,

            My R^2 is actually consistent with the other researchers, and since I am using a time-series data, autocorrelation is found:


            Code:
            . gen year=year(date)
            
            . regress csad c.abs_r_mt##c.abs_r_mt i.year
            
                  Source |       SS           df       MS      Number of obs   =     2,609
            -------------+----------------------------------   F(11, 2597)     =    253.85
                   Model |  731.315933        11  66.4832667   Prob > F        =    0.0000
                Residual |  680.141573     2,597  .261895099   R-squared       =    0.5181
            -------------+----------------------------------   Adj R-squared   =    0.5161
                   Total |  1411.45751     2,608  .541203032   Root MSE        =    .51176
            
            ---------------------------------------------------------------------------------------
                             csad |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            ----------------------+----------------------------------------------------------------
                         abs_r_mt |   .5762418   .0153312    37.59   0.000     .5461793    .6063044
                                  |
            c.abs_r_mt#c.abs_r_mt |  -.0557956   .0020825   -26.79   0.000    -.0598792    -.051712
                                  |
                             year |
                            2002  |  -.0984432   .0451764    -2.18   0.029    -.1870286   -.0098579
                            2003  |    .122118   .0454211     2.69   0.007     .0330527    .2111833
                            2004  |    .405986   .0452459     8.97   0.000     .3172644    .4947076
                            2005  |   .7788927   .0451712    17.24   0.000     .6903174     .867468
                            2006  |   .7770878   .0451397    17.22   0.000     .6885743    .8656013
                            2007  |   .5912376   .0448429    13.18   0.000     .5033062    .6791691
                            2008  |   .3693285   .0448179     8.24   0.000     .2814461     .457211
                            2009  |   .2269734   .0450284     5.04   0.000     .1386782    .3152686
                            2010  |   .1245081   .0452183     2.75   0.006     .0358406    .2131757
                                  |
                            _cons |   .4941324    .035398    13.96   0.000     .4247213    .5635435
            ---------------------------------------------------------------------------------------
            
            . estat bgodfrey
            
            Number of gaps in sample:  521
            
            Breusch-Godfrey LM test for autocorrelation
            ---------------------------------------------------------------------------
                lags(p)  |          chi2               df                 Prob > chi2
            -------------+-------------------------------------------------------------
                   1     |        357.984               1                   0.0000
            ---------------------------------------------------------------------------
                                    H0: no serial correlation
            How do I, then, implement Newey-West Standard Errors in my regression to counter the effect of heteroskedasticity and autocorrelation? I will justify the use of the said Standard Error in the later part of my research and will try to fit an AR model but I will be happy for now as long as my regression can be interpreted normally, hence the use of Newey-West SE as a 'fast track'.

            Comment


            • #21
              Dear Carlo,

              I have figured out how to implement Newey-West SE in my regression, however, the following popped up:

              Code:
              . newey csad c.abs_r_mt##c.abs_r_mt, lag(0)
              
              Regression with Newey-West standard errors      Number of obs     =      2,609
              maximum lag: 0                                  F(  2,      2606) =     575.92
                                                              Prob > F          =     0.0000
              
              ---------------------------------------------------------------------------------------
                                    |             Newey-West
                               csad |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              ----------------------+----------------------------------------------------------------
                           abs_r_mt |   .5900881   .0185185    31.86   0.000     .5537757    .6264006
                                    |
              c.abs_r_mt#c.abs_r_mt |  -.0573132    .002388   -24.00   0.000    -.0619958   -.0526307
                                    |
                              _cons |   .8116755   .0187512    43.29   0.000     .7749067    .8484443
              ---------------------------------------------------------------------------------------
              
              . regress csad c.abs_r_mt##c.abs_r_mt
              
                    Source |       SS           df       MS      Number of obs   =     2,609
              -------------+----------------------------------   F(2, 2606)      =    728.54
                     Model |  506.167349         2  253.083674   Prob > F        =    0.0000
                  Residual |  905.290158     2,606   .34738686   R-squared       =    0.3586
              -------------+----------------------------------   Adj R-squared   =    0.3581
                     Total |  1411.45751     2,608  .541203032   Root MSE        =     .5894
              
              ---------------------------------------------------------------------------------------
                               csad |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              ----------------------+----------------------------------------------------------------
                           abs_r_mt |   .5900881    .017454    33.81   0.000     .5558629    .6243133
                                    |
              c.abs_r_mt#c.abs_r_mt |  -.0573132   .0023925   -23.96   0.000    -.0620046   -.0526219
                                    |
                              _cons |   .8116755   .0185891    43.66   0.000     .7752247    .8481264
              ---------------------------------------------------------------------------------------
              
              . newey csad c.abs_r_mt##c.abs_r_mt, lag(2)
              date is not regularly spaced
              r(198);
              
              . newey csad c.abs_r_mt##c.abs_r_mt, lag(1)
              date is not regularly spaced
              r(198);
              As I have mentioned before, I am dealing with stock market data and there will be days, for example, public holidays and the typical weekends, when the stock markets are not open. I then executed -force- to let Stata know that the missing dates were innocuous (I am not sure if this practice is okay), and the following showed up:

              Code:
              . newey csad c.abs_r_mt##c.abs_r_mt, lag(1) force
              
              Regression with Newey-West standard errors      Number of obs     =      2,609
              maximum lag: 1                                  F(  2,      2606) =     472.98
                                                              Prob > F          =     0.0000
              
              ------------------------------------------------------------------------------
                           |             Newey-West
                      csad |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                  abs_r_mt |   .5900881    .020285    29.09   0.000     .5503118    .6298645
                           |
                c.abs_r_mt#|
                c.abs_r_mt |  -.0573132   .0025501   -22.48   0.000    -.0623136   -.0523128
                           |
                     _cons |   .8116755   .0217257    37.36   0.000     .7690742    .8542769
              ------------------------------------------------------------------------------
              I am satisfactory with the outcome, as it has not changed significantly and my parameter of interest, the second row, gives me the same inference. Should I be glad that this is the case?
              Last edited by sladmin; 09 Apr 2018, 09:00. Reason: anonymize poster

              Comment


              • #22
                Guest:
                I'd be quite satisfied with those results, but the need for other predictors still holds.
                Last edited by sladmin; 09 Apr 2018, 09:00. Reason: anonymize poster
                Kind regards,
                Carlo
                (Stata 18.0 SE)

                Comment

                Working...
                X