Announcement

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

  • Ordered Probit Postestimation

    Dear all Stata users,

    I have been trying to do postestimation for a ordered probit model for each of my 3 possible outcomes, but I keep getting error messages:

    outcome() must either be a value of status,
    or #1, #2, ...

    outcome 1 not found
    outcome() must either be a value of status,
    or #1, #2, ...

    So, if anyone could help me with this issue, I appreciate it.

    And one more question: What is the interpretation for \cut1, cut2, and so.

    That's' my code and data:

    Code:
    * Ordered probit model marginal effects
    margins, dydx(*) atmeans predict(outcome(1))
    margins, dydx(*) atmeans predict(outcome(2))
    margins, dydx(*) atmeans predict(outcome(3))
    
    //Ordered probit model predicted probabilities
    predict p1oprobit, pr outcome(1)
    predict p2oprobit, pr outcome(2)
    predict p3oprobit, pr outcome(3)
    //summarize p1oprobit p2oprobit p2oprobit
    //tabulate status
    ----------------------- copy starting from the next line -----------------------
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte(status boy) float age int income byte govaid float night double(lib sci comp sports tage tagesd twom) float(stu_staff_ratio noatte) double(sroom child element) str4 truancy_status
    3 1 15.3    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  65 18 1 1 "high"
    3 1 16.3    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  85 25 1 1 "high"
    2 1 16.6    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  51 18 1 1 "med" 
    2 0 16.1    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093 164 18 1 1 "med" 
    3 1 15.8    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  15 25 1 1 "high"
    3 0 15.8    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  16 18 1 1 "high"
    2 1 15.4    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  87 18 1 1 "med" 
    3 0 15.5    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  55 25 1 1 "high"
    3 0 15.9    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  35 18 1 1 "high"
    3 0 16.7    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  65 25 1 1 "high"
    3 0 15.9    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  52 18 1 1 "high"
    3 0 15.2  800 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  60 18 1 1 "high"
    3 1 15.1    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  17 25 1 1 "high"
    3 0 15.7    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  44 18 1 1 "high"
    3 0 15.8    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  76 18 1 1 "high"
    3 0 15.9    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  57 25 1 1 "high"
    2 0 17.5    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093 203 25 1 1 "med" 
    3 0 15.2    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  20 25 1 1 "high"
    3 0 15.9    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  30 25 1 1 "high"
    3 1 15.5    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  88 25 1 1 "high"
    3 0 15.9    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  54 25 1 1 "high"
    2 1 17.1    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093 146 25 1 1 "med" 
    2 0 17.6    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  72 25 1 1 "med" 
    2 1 16.3    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  93 18 1 1 "med" 
    2 0 16.7    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  58 25 1 1 "med" 
    3 1 15.3    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  36 18 1 1 "high"
    2 0 15.9    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093 142 25 1 1 "med" 
    3 1 15.3    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  30 18 1 1 "high"
    2 1   16    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093 177 25 1 1 "med" 
    1 1 16.4  700 0 0 1 1 1 0 43.54 10.11 81.08 .8372093   . 18 1 1 "low" 
    2 1 15.6    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  92 25 1 1 "med" 
    2 1   17    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093 185 25 1 1 "med" 
    2 1 16.1    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  77 25 1 1 "med" 
    2 0 15.8    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  63 25 1 1 "med" 
    3 1 16.1    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  39 18 1 1 "high"
    3 0 14.9    . 0 0 1 1 1 0 43.54 10.11 81.08 .8372093  23 25 1 1 "high"
    3 0 16.8    . 0 0 1 1 1 0 43.54 10.11 81.08 1.767442  82 19 1 1 "high"
    3 0 17.7    . 0 0 1 1 1 0 43.54 10.11 81.08 1.767442  57 19 1 1 "high"
    3 0 16.9    . 0 0 1 1 1 0 43.54 10.11 81.08 1.767442  34 19 1 1 "high"
    3 0 18.6    . 0 0 1 1 1 0 43.54 10.11 81.08 1.767442  79 31 1 1 "high"
    3 0 15.2    . 0 0 1 1 1 0 43.54 10.11 81.08 1.767442  21 14 1 1 "high"
    3 1 15.1    . 0 0 1 1 1 0 43.54 10.11 81.08 1.767442  22 31 1 1 "high"
    3 1 15.8    . 0 0 1 1 1 0 43.54 10.11 81.08 1.767442  56 31 1 1 "high"
    3 1 15.7    . 0 0 1 1 1 0 43.54 10.11 81.08 1.767442  65 31 1 1 "high"
    3 1 15.9 1000 0 1 1 1 1 0 43.54 10.11 81.08 1.767442  38 17 1 1 "high"
    3 0 16.9    . 0 1 1 1 1 0 43.54 10.11 81.08 1.767442  30  3 1 1 "high"
    2 0 18.4    . 0 0 1 1 1 0 43.54 10.11 81.08 1.767442 118 31 1 1 "med" 
    3 0 15.9    . 0 0 1 1 1 0 43.54 10.11 81.08 1.767442  18 19 1 1 "high"
    3 1 16.8    . 0 1 1 1 1 0 43.54 10.11 81.08 1.767442   8  3 1 1 "high"
    3 1 15.8    . 0 0 1 1 1 0 43.54 10.11 81.08 1.767442  24 14 1 1 "high"
    end
    ------------------ copy up to and including the previous line ------------------

    Listed 50 out of 84409 observations


    Thank you all,

    Max





  • #2
    What was the actual oprobit command?

    I simply ran

    Code:
    oprobit status
    and all of your margins and predict commands seemed to run fine.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Incidentally, unless you have an ancient version of Stata, you are making this too hard:

      Code:
      oprobit status
      * Ordered probit model marginal effects
      margins, dydx(*) atmeans 
      
      //Ordered probit model predicted probabilities
      predict p1oprobit p2oprobit p3oprobit
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      StataNow Version: 19.5 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment


      • #4
        I am runing the following model:

        Code:
         Ordered probit model coefficients
        oprobit status boy age income govaid night lib sci comp sports tage tagesd twom stu_staff_ratio noatte sroom chil element if c == 2008
        
        * Ordered probit model predicted probabilities
        predict p1oprobit p2oprobit p3oprobit
        And iam getting the following error message:
        predict p1oprobit p2oprobit p3oprobit
        (option pr assumed; predicted probabilities)
        too many variables specified
        status has 2 outcomes and so you must specify 2 new variables, or
        you can use the outcome() option and specify variables one at a time
        I have 3 outcomes on my status...1 , 2 and 3.

        I don't get why he is not doing Pr(status==1), predict(pr outcome(1)) if i have 3 outcomes.

        Thank you for the quick answer Richard Williams

        Max
        Last edited by Max Resende; 04 Dec 2019, 15:09.

        Comment


        • #5
          I can't get your oprobit command to run with the extract you provided. But, my guess is that missing data is causing you to lose one of the categories of status. After the oprobit command, try running

          Code:
          tab1 status if e(sample)
          This will show you what values of status actually appeared in your estimation sample.
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment


          • #6
            Richard, you are right. For me to obtain status ==1, I had to drop income ( too many missing values).

            Comment

            Working...
            X