Announcement

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

  • Equal slope t-test

    Hello,

    I ran two seperate regressions on two portfolios. The regressors are the Fama/French Factors. Because the portfolio excess-returns are already time series averages, I ran a regression with Newey-West adjusted std. errors.

    The code looks like this:
    Code:
     tsset ym
    newey portfolio1 mktrf smb hml, lag(6)
    newey portfolio2 mktrf smb hml, lag(6)
    Here is an example of my dataset:
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(ym portfolio1 portfolio2 mktrf smb hml)
    210 -1.0934919 -1.2953682  -1.69  2.12  -.59
    211 -1.5076194  -.9989501  -1.75  1.52 -2.79
    212   1.846868  1.8286937   -.27  1.45  -.49
    213  -2.503698 -2.2496798  -4.38  1.27  1.72
    214   9.566316   7.653448      4  3.72   .31
    215  1.5677294   .4746514    .27  1.35  -.37
    216  -3.239614  -4.017523  -6.01  2.22  3.31
    217    2.35551  1.5107986  -1.38  3.59   .76
    218    6.92542   4.650113   2.85  3.48   1.2
    219   9.188552   7.253043   7.88    .4 -3.54
    220    5.65227   5.163275   1.76  4.56  -.62
    221 -1.0532163 -1.5494046  -1.69  1.69   .59
    222    6.21275    5.09622   5.11   .26 -1.11
    223   7.366338   7.396804   3.75  5.06  -.46
    end
    format %tm ym
    Now I want to run a t-test, that tests if the slopes of the coefficients are equal.

    Any help is highly appreciated.

    Best regards
    Steven

  • #2
    push

    Comment


    • #3
      Since you have two different models I am not sure whether you can apply a ttest here. What might work is bootstrapping the coefficients or the difference of the two coefficients. Some infos are provided here:

      https://www.statalist.org/forums/for...ing-difference
      Best wishes

      Stata 18.0 MP | ORCID | Google Scholar

      Comment


      • #4
        Thank you!

        I found this Excel tool: http://www.real-statistics.com/regre...ndent-samples/

        Comment


        • #5
          Code:
          * Example generated by -dataex-. To install: ssc install dataex
          clear
          input float(ym portfolio1 portfolio2 mktrf smb hml)
          210 -1.0934919 -1.2953682 -1.69 2.12  -.59
          211 -1.5076194  -.9989501 -1.75 1.52 -2.79
          212   1.846868  1.8286937  -.27 1.45  -.49
          213  -2.503698 -2.2496798 -4.38 1.27  1.72
          214   9.566316   7.653448     4 3.72   .31
          215  1.5677294   .4746514   .27 1.35  -.37
          216  -3.239614  -4.017523 -6.01 2.22  3.31
          217    2.35551  1.5107986 -1.38 3.59   .76
          218    6.92542   4.650113  2.85 3.48   1.2
          219   9.188552   7.253043  7.88   .4 -3.54
          220    5.65227   5.163275  1.76 4.56  -.62
          221 -1.0532163 -1.5494046 -1.69 1.69   .59
          222    6.21275    5.09622  5.11  .26 -1.11
          223   7.366338   7.396804  3.75 5.06  -.46
          end
          format %tm ym
          tsset ym
          newey portfolio1 mktrf smb hml, lag(6)
          newey portfolio2 mktrf smb hml, lag(6)
          reshape long portfolio, i(ym) j(which)
          gen cons=1
          xtset which ym
          newey portfolio i.which#(c.mktrf c.smb c.hml c.cons), nocons lag(6) force
          test 1.which#c.mktrf= 2.which#c.mktrf
          Res.:

          Code:
          . newey portfolio1 mktrf smb hml, lag(6)
          
          Regression with Newey-West standard errors      Number of obs     =         14
          maximum lag: 6                                  F(  3,        10) =     952.41
                                                          Prob > F          =     0.0000
          
          ------------------------------------------------------------------------------
                       |             Newey-West
            portfolio1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                 mktrf |   1.234743   .0417266    29.59   0.000     1.141771    1.327716
                   smb |   .6274821    .083693     7.50   0.000     .4410024    .8139618
                   hml |   .5421417   .0880386     6.16   0.000     .3459796    .7383038
                 _cons |   .8189856   .2421786     3.38   0.007     .2793781    1.358593
          ------------------------------------------------------------------------------
          
          . 
          . newey portfolio2 mktrf smb hml, lag(6)
          
          Regression with Newey-West standard errors      Number of obs     =         14
          maximum lag: 6                                  F(  3,        10) =     572.27
                                                          Prob > F          =     0.0000
          
          ------------------------------------------------------------------------------
                       |             Newey-West
            portfolio2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                 mktrf |   .9925192   .0369522    26.86   0.000     .9101847    1.074854
                   smb |   .7732963   .0851198     9.08   0.000     .5836376     .962955
                   hml |    .157638   .1168031     1.35   0.207    -.1026156    .4178915
                 _cons |  -.1729882   .3936944    -0.44   0.670    -1.050194    .7042175
          ------------------------------------------------------------------------------
          
          . newey portfolio i.which#(c.mktrf c.smb c.hml c.cons), nocons lag(6) force
          
          Regression with Newey-West standard errors      Number of obs     =         28
          maximum lag: 6                                  F(  8,        20) =    1137.83
                                                          Prob > F          =     0.0000
          
          -------------------------------------------------------------------------------
                        |             Newey-West
              portfolio |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          --------------+----------------------------------------------------------------
          which#c.mktrf |
                     1  |   1.234743   .0417266    29.59   0.000     1.147703    1.321783
                     2  |   .9925192   .0369522    26.86   0.000     .9154384      1.0696
                        |
            which#c.smb |
                     1  |   .6274821    .083693     7.50   0.000     .4529015    .8020627
                     2  |   .7732963   .0851198     9.08   0.000     .5957395    .9508531
                        |
            which#c.hml |
                     1  |   .5421417   .0880386     6.16   0.000     .3584965    .7257869
                     2  |    .157638   .1168031     1.35   0.192    -.0860091     .401285
                        |
           which#c.cons |
                     1  |   .8189856   .2421786     3.38   0.003     .3138099    1.324161
                     2  |  -.1729882   .3936944    -0.44   0.665    -.9942202    .6482439
          -------------------------------------------------------------------------------
          
          . 
          . test 1.which#c.mktrf= 2.which#c.mktrf
          
           ( 1)  1b.which#c.mktrf - 2.which#c.mktrf = 0
          
                 F(  1,    20) =   18.89
                      Prob > F =    0.0003

          Comment


          • #6
            Thank you very much!

            Comment

            Working...
            X