Announcement

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

  • Ordered logit/probit, post-estimation prediction of outcome variable

    Hello,

    I have a (very, very basic) query on ordered logit and probit models, and post-estimation prediction.

    Below is an extract of a dataset of sovereign credit ratings, with ratings displayed numerically from 6 to 21 (variable FCLTN). I am running ordered logit and probit models. I want to create a new variable showing the most likely outcome of FCLTN.

    I have so far used basic -predict- as below, to show probabilities of each value of FCLTN. I have also used option xb, to give the linear prediction which responds to each cut in the output table of the logit/probit estimation. Is there an easy way of generating a single new variable showing the prediction of the most probable value of FCLTN, rather than the cut value?

    Many thanks for your help.


    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str38 Sovereign int Year byte FCLTN double(NGDPDPC_PR lnNGDPD rGDP_FiveYrAvg Infl_5YrAvg LUR DebtGDP_3YrAvg Net_intGGR_three_yr_avg RCF CAB_3YrAvg NIIP_3YrAvg)
    "Finland"      2003 21  .93 -1.287354413264987  3.217            2.0566 10.4200000762939            41.792 -.1015953493623254 3.2692334780363037  5.911666666666666 -87.64018741633936
    "Belgium"      2003 20  .92  -.579818495252942 2.2266            1.7408 6.90999984741211           101.422   9.97943510991553 3.2692334780363037  3.665666666666667   48.9314525471409
    "France"       2003 21 .914  1.151837049905408 2.1244            1.3576 8.69999980926514            63.537  5.145278845596869 3.2692334780363037               .839  3.866736799588227
    "Greece"       2003 17 .824 -.8255363686056909 4.5662            3.4236 9.97000026702881 103.9396666666667  12.99103851036296 3.2692334780363037 -6.078666666666667 -46.44608470122292
    "Isle of Man"  2003 21    .                  .      .                 .                .                 .                  .                  0                  .                  .
    "Hungary"      2003 15 .744 -1.214023140179438 4.4404             9.679  5.6100001335144 57.53833333333333  8.846201355379952                  0 -7.623666666666668 -70.31339227007135
    "Suriname"     2003  6 .579 -4.828313737302302 4.4088           30.2426 11.1529998779297 32.12433333333333   5.15691960084964                  0 -8.524666666666667  2.846183641406267
    "Andorra"      2003 18    . -5.298317366548036      .                 .                .            15.178 -5.938958221227865                  0                  .                  .
    "Colombia"     2003 10 .489 -.6558513958162484 3.2716           10.6104 14.4799995422363            44.689  13.88031029423858                  0              -.987 -24.80793361815346
    "South Africa" 2003 13 .611 -.2797139028026041 3.6208 6.435600000000001 33.2900009155273 31.34933333333333  14.89804141555594                  0 -.7999999999999999 -13.37625427651014
    end
    
    ologit FCLTN NGDPDPC_PR lnNGDPD  rGDP_FiveYrAvg  Infl_5YrAvg LUR DebtGDP_3YrAvg Net_intGGR_three_yr_avg  RCF CAB_3YrAvg NIIP
    predict p*
    predict yhat, xb

  • #2
    Based on Wooldridge's book, you need to manually compute the prediction then see where it falls in the cutpoints.

    To do so, you use the coefficient multiplied by the respective means as I don't think there's a predict option to do that.

    So something like this:

    Code:
    qui tabstat x1 x2 x3 value, save
    qui matrix B = r(StatTotal)
    
    qui ologit y treat0 x1 x2 x3 
    scalar mm0 = _b[x1]*B[1,1]+_b[x2]*B[1,2]+_b[x3]*B[1,3]
    scalar mm1 = _b[treat0]+_b[x1]*B[1,1]+_b[x2]*B[1,2]+_b[x3]*B[1,3]
    di mm0
    di mm1

    Comment

    Working...
    X