Announcement

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

  • Out of sample predicted probabilities from probit

    Hello everyone,

    I'm trying to replicate output produced by the NY Federal Reserve, but am a bit confused as to how they're forecasting out of sample from a probit, and how to do so in Stata. They provide their data here. They're using a probit model and report "Probability of US Recession Predicted by Treasury Spread* Twelve Months Ahead (month averages)." There's example data below. I understand how to get predicted probabilities by using the predict command after running probit, but not the "Twelve Months Ahead ( month averages)." If anyone has any ideas how to interpret and reproduce those results I'd really appreciate it!

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int date double(tenyr threemon spread) byte nber_rec
    -335 4.02 2.82 1.1403059139902267 0
    -307 3.96  2.7 1.2036881717723462 0
    -276 3.99  2.8 1.1308748587222905 0
    -246 4.12 2.95  1.106556698491949 0
    -215 4.31 2.84 1.4097348744710638 0
    -185 4.34 3.21  1.058792401343232 0
    -154  4.4  3.2  1.129097589389731 0
    -123 4.43 3.38  .9735238070156065 0
     -93 4.68 4.04  .5416269031857555 0
     -62 4.53 4.05 .38127745292431303 0
     -32 4.53 4.15  .2777538680070233 0
      -1 4.69 4.49 .08537770490126739 0
      30 4.72 4.35 .26054794174274676 0
      59 4.49 3.96  .4344034788230182 0
      90 4.25 3.31  .8657116249598373 0
     120 4.28 3.23   .978180449430587 0
     151 4.35 3.29  .9863319842434066 1
     181 4.15 2.46 1.6402267265277928 1
     212  3.9  2.3 1.5544186059507075 1
     243  3.8  2.3 1.4544186059507074 1
    end
    format %td date
    Code:
    probit nber_rec spread

  • #2
    Learn about Stata's time series operators by reading -help tsvarlist- and the manual section linked therein.

    Unfortunately, although your data is actually monthly, it is given as daily dates corresponding to the last day of the month. So to get this right, you will need to extract monthly dates from the given dates first. So it will look something like this:

    Code:
    gen mdate = mofd(date)
    format mdate %tm
    tsset mdate
    
    probit nber_rec L12.spread
    Added: By the way, what you are referring to do is not "out of sample" prediction. Out of sample prediction arises when you apply the -predict- command to observations that were not part of the sample from which the probit regression was actually estimated. At least in what you've described and shown, you are not doing that.
    Last edited by Clyde Schechter; 12 Dec 2018, 23:27.

    Comment


    • #3
      Clyde,

      Thank you very much, I am now able to produce the same estimates. The predictions extend to November 2019, I just didn't include the full data set (actuals begin in January 1959 and end in November 2018). If you don't mind, could you kindly explain why lag 12? Are we lagging the spread to give the "Twelve Months Ahead" probability?

      If it helps, here's where I obtained the data
      Code:
      !curl -L https://www.newyorkfed.org/medialibrary/media/research/capital_markets/allmonth.xls> 'allmonth.xls'
      import excel using allmonth.xls, firstrow case(lower) clear

      Comment


      • #4
        If you don't mind, could you kindly explain why lag 12? Are we lagging the spread to give the "Twelve Months Ahead" probability?
        Yes, exactly. If the spread predicts the outcome 12 months ahead, then the predictor for a given outcome is the spread from 12 months earlier.

        Comment


        • #5
          Thanks, Clyde. I appreciate your help!

          Comment

          Working...
          X