Announcement

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

  • #31
    Thanks, John! That solved the problem I made by not understanding the syntax. It works fine now. Thanks again!

    Take care.
    Sam

    Comment


    • #32
      Originally posted by John Mullahy View Post
      Malcolm: I would recommend using the mvnormalderiv(.) functions in Mata. The analytic code in my EE paper is admittedly awkward to implement, and still needs to call a multivariate normal joint distribution in any event. I've recently been using mvnormalderiv(.)with success, and it sure cleans up the programming algebra. See
      Code:
      help mf_mvnormal
      mvnormalderiv(.) will return an M-vector of derivatives w.r.t. the points of evaluation. These can be converted into the PEs using the chain rule and then summing. PEs conditional on other y-outcomes follows essentially the same logic.
      I am new here. I am working on a multivariate probit model with four binary outcome variables. I was able to fit the model using the mvpmvp() in Mata as you suggested. Please, can you guide me on how to obtain the joint probabilities of the outcomes and the marginal effects of the regressors. Thanks for your support.

      Comment


      • #33
        If you use bvpmvp() you will likely need to extract the results (e.g. from a log file) and then use Mata's mvnormal() or mvnormalqp() functions to compute the joint probabilities. For marginal effects you will need to take appropriate differences in joint probabilities computed at different x-values (for discrete x) or use mvnormalderiv() as indicated earlier in this thread (for continuous x).

        The cut-and-paste results reported by bvpmvp() were implemented with this kind of effort in mind.

        Comment


        • #34
          If you fit your model using -mvprobit- (SSC), post-estimation command -mvppred- will give you the predicted probs of all-1 responses. Alternatively, one can use the routines released with the Cappellari-Jenkins 2006 article in the SJ (faster) -- uses a plug-in to do maximum simulated likelihood. John's Mata commands are of course faster still and, as he indicates, can be used to derive predicted probabilities and "marginal effects" (MEs). Whatever route you go, realise that it's tricky stuff, with no easy shortcuts. Note also that there are many different MEs that you could define and calculate (change in which joint probability and with respect to which predictor(s), discrete or continuous?). Even for the bivariate case, MEs are not so straighforward -- look through the Manual discussion for the bivariate probit case (and you have 4 outcomes!)

          Comment


          • #35
            Originally posted by John Mullahy View Post
            If you use bvpmvp() you will likely need to extract the results (e.g. from a log file) and then use Mata's mvnormal() or mvnormalqp() functions to compute the joint probabilities. For marginal effects you will need to take appropriate differences in joint probabilities computed at different x-values (for discrete x) or use mvnormalderiv() as indicated earlier in this thread (for continuous x).

            The cut-and-paste results reported by bvpmvp() were implemented with this kind of effort in mind.
            Thanks a million for your prompt response. I encountered two issues while using bvpmvp(). First, I am interested in weighted MVP regression, but there is no option for weights in the bvpmvp() code. Second, I exported the results from bvpmvp() to an Excel file using putexcel. However, I discovered each of my outcome variables (nothing, borrow, loan and sale) occurred in a block of 38 * 3 columns (including 37 regressors+ _cons in each block) in the following order: these blocks appear in a particular order corresponding to the different outcome equations (for example, “nothing”, “borrow”, “loan”, “sale”) as well as additional blocks for the auxiliary parameters (labelled “at~o”) as follows:
            • Block for nothing: columns 1–38
            • Block for borrow: columns 39–76
            • Block for nothing (again): columns 78–115
            • Block for loan: columns 116–153
            • Block for nothing (a third occurrence): columns 155–192
            • Block for sale: columns 193–230
            • Block for borrow (second occurrence): columns 232–269
            • Block for loan (second occurrence): columns 270–307
            • Block for borrow (third occurrence): columns 309–346
            • Block for sale (second occurrence): columns 347–384
            • Block for loan (third occurrence): columns 386–423
            • Block for sale (third occurrence): columns 424–461
            • The columns 77, 154, 231, 308, 385, and 462 are reserved for the auxiliary parameters labeled “at~o.”

              I can't make sense of what these multiple values for each outcome represent.

              Moreover, as I mata and programming in Stata are relatively new to me, I find it difficult to understand how to implement your suggestion "For marginal effects you will need to take appropriate differences in joint probabilities computed at different x-values (for discrete x) or use mvnormalderiv() as indicated earlier in this thread (for continuous x)." Therefore, a code guiding me through these steps will be highly appreciated. Eagerly looking forward to your reply. Thank you!




            Comment


            • #36
              Originally posted by Stephen Jenkins View Post
              If you fit your model using -mvprobit- (SSC), post-estimation command -mvppred- will give you the predicted probs of all-1 responses. Alternatively, one can use the routines released with the Cappellari-Jenkins 2006 article in the SJ (faster) -- uses a plug-in to do maximum simulated likelihood. John's Mata commands are of course faster still and, as he indicates, can be used to derive predicted probabilities and "marginal effects" (MEs). Whatever route you go, realise that it's tricky stuff, with no easy shortcuts. Note also that there are many different MEs that you could define and calculate (change in which joint probability and with respect to which predictor(s), discrete or continuous?). Even for the bivariate case, MEs are not so straighforward -- look through the Manual discussion for the bivariate probit case (and you have 4 outcomes!)
              Thanks a million for your invaluable suggestions. I am interested in average marginal effects (AME) and the joint probabilities for the outcome variables. I was able to fit my models with mvprobit, cmp and mvpmvp() in mata as I explained earlier. I read through your paper Cappellari-Jenkins 2006 and find it very interesting. You indicated "The second, and perhaps more useful, application of one-off calculations is generation of predicted probabilities of multiple outcome variables after estimation of multivariate probit (and related) models...With mvnp(), the predicted probability of any combination of ones and zeros can be derived". It appears you did not demonstrate further how this is done. Unfortunately, I didn't understand how to implement this, as it will be useful for my joint probability estimation. could you help me with this, bearing in mind that I am a Stata beginner. Can your method also estimate the average marginal effect? Looking forward to your insightful reply.
              Last edited by Adelakun Odunyemi; 06 Feb 2025, 18:00.

              Comment


              • #37
                Originally posted by Stephen Jenkins View Post
                If you fit your model using -mvprobit- (SSC), post-estimation command -mvppred- will give you the predicted probs of all-1 responses. Alternatively, one can use the routines released with the Cappellari-Jenkins 2006 article in the SJ (faster) -- uses a plug-in to do maximum simulated likelihood. John's Mata commands are of course faster still and, as he indicates, can be used to derive predicted probabilities and "marginal effects" (MEs). Whatever route you go, realise that it's tricky stuff, with no easy shortcuts. Note also that there are many different MEs that you could define and calculate (change in which joint probability and with respect to which predictor(s), discrete or continuous?). Even for the bivariate case, MEs are not so straighforward -- look through the Manual discussion for the bivariate probit case (and you have 4 outcomes!)
                Hello, Stephen Jenkins. Can you explain how I can use the routines released with the Cappellari-Jenkins 2006 article to estimate joint predictive probabilities of any combination of ones and zeros? Thank you

                Comment

                Working...
                X