Announcement

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

  • mvprobit

    Hello you all,

    I need help with my mvprobit.

    I have 3 outcomes with the binary, category, and continuous explanatory variables. Whenever I put "i" in front of the binary and category variables, I get error of r(101)..see below.

    I later started the model with xi:mvprobit and inserted "i" in front of the category variables but I still get error. What sort of variables are allowed in such an mvprobit model.
    Click image for larger version

Name:	Screenshot 2024-08-07 123014.png
Views:	1
Size:	27.3 KB
ID:	1760943

  • #2
    The error message means exactly what it says. -mvprobit- does not support factor variable notation. For your discrete explanatory variables you will need to create your own indicator variables. This is one of those situations where the otherwise obsolete -xi:- prefix still plays a role. So if you precede your command with an -xi:- prefix and use i. on your discrete variables, you will get results similar to what you would get with factor-variable notation. -xi- does not deal with c. however--so just leave those out. See -help xi- for details on how to use -xi:-. Also note that -margins- cannot use the results produced by -xi:- analyses. You simply will not have any access to -margins- after -mvprobit-.

    The reason -mvprobit- does not support factor variable notation is that it was originally written in 2003, and most recently updated in 2006, which is long before Stata introduced factor-variable notation.

    Comment


    • #3
      I did the following.

      1. Opened mvprobit from my ado/plus folder.
      2. Saved it as mvprobit2.
      3. Change line 10 to mvprobit2.
      4. Change line 11 to version 12.
      5. Change line 58:

      From: syntax [varlist(default=none)] [, noCONstant]
      To: syntax [varlist(default=none ts fv)] [, noCONstant]

      6. Ran regression with factor variable. It produced the results.

      Code:
      use http://www.stata-press.com/data/r7/school.dta, clear
      mvprobit2 (private = years logptax loginc i.school) (vote = years logptax loginc i.school), dr(15)

      Comment


      • #4
        You can also just edit mvprobit using lines 4 and 5 and save it.

        Comment


        • #5
          Thank you for the assistance. I created indicator variables using tabulate(xx), generate(xxx) for all the factor variables. I then put each of the indicator variables in my model with an "in" in front. I also made sure i started my model with xi:mvprobit.

          But i get an error. It says: initial values not feasible r(1400);
          How do I solve this issue to get my mvprobit running smoothly?


          . xi:mvprobit (CHARCL = AGE i.GENDER i.educself1 i.educself2 i.educself3 i.educself4 i.educself5 i.educself6 i.educself7
          > i.educself8 i.educself9 HHSIZE i.bemba_spaeking i.tonga_speaking i.northwestern i.barotse_group i.nyanja_speaking i.m
          > ambwe_group i.tumbuka_speaking i.other_group i.marital1 i.marital2 i.marital3 i.marital4 i.marital5 i.income11 i.incom
          > e12 i.income13 i.income14 i.income15 i.income16 i.income17 i.income18 i.income19 i.income21 i.income22 i.income23 i.in
          > come24 i.income25 i.income26 i.income27 i.income28 i.income29 i.hhincome1 i.hhincome2 i.hhincome3 i.hhincome4 i.hhinco
          > me5 i.hhincome6 HEADINCOM i.resid_incom1 i.resid_incom2 i.resid_incom3 i.roof1 i.roof2 i.roof3 i.roof4 i.floor1 i.floo
          > r2 i.floor3 i.floor4 i.floor5 i.walls1 i.walls2 i.walls3 i.ELEC i.PLUMB i.MOBILE i.RADIO i.TELE i.REFRIG i.CHARCBRAZ_A
          > ST i.ELECTHOTPLAT_AST i.rescode1 i.rescode2 i.rescode3)
          > (LPG_KEROSEN = AGE i.GENDER i.educself1 i.educself2 i.educself3 i.educself4 i.educself5 i.educself6 i.educs
          > elf7 i.educself8 i.educself9 HHSIZE i.bemba_spaeking i.tonga_speaking i.northwestern i.barotse_group i.nyanja_speaking
          > i.mambwe_group i.tumbuka_speaking i.other_group i.marital1 i.marital2 i.marital3 i.marital4 i.marital5 i.income11 i.i
          > ncome12 i.income13 i.income14 i.income15 i.income16 i.income17 i.income18 i.income19 i.income21 i.income22 i.income23
          > i.income24 i.income25 i.income26 i.income27 i.income28 i.income29 i.hhincome1 i.hhincome2 i.hhincome3 i.hhincome4 i.hh
          > income5 i.hhincome6 HEADINCOM i.resid_incom1 i.resid_incom2 i.resid_incom3 i.roof1 i.roof2 i.roof3 i.roof4 i.floor1 i.
          > floor2 i.floor3 i.floor4 i.floor5 i.walls1 i.walls2 i.walls3 i.ELEC i.PLUMB i.MOBILE i.RADIO i.TELE i.REFRIG i.CHARCBR
          > AZ_AST i.ELECTHOTPLAT_AST i.rescode1 i.rescode2 i.rescode3)
          > (ELECTR = AGE i.GENDER i.educself1 i.educself2 i.educself3 i.educself4 i.educself5 i.educself6 i.educse
          > lf7 i.educself8 i.educself9 HHSIZE i.bemba_spaeking i.tonga_speaking i.northwestern i.barotse_group i.nyanja_speaking
          > i.mambwe_group i.tumbuka_speaking i.other_group i.marital1 i.marital2 i.marital3 i.marital4 i.marital5 i.income11 i.in
          > come12 i.income13 i.income14 i.income15 i.income16 i.income17 i.income18 i.income19 i.income21 i.income22 i.income23 i
          > .income24 i.income25 i.income26 i.income27 i.income28 i.income29 i.hhincome1 i.hhincome2 i.hhincome3 i.hhincome4 i.hhi
          > ncome5 i.hhincome6 HEADINCOM i.resid_incom1 i.resid_incom2 i.resid_incom3 i.roof1 i.roof2 i.roof3 i.roof4 i.floor1 i.f
          > loor2 i.floor3 i.floor4 i.floor5 i.walls1 i.walls2 i.walls3 i.ELEC i.PLUMB i.MOBILE i.RADIO i.TELE i.REFRIG i.CHARCBRA
          > Z_AST i.ELECTHOTPLAT_AST i.rescode1 i.rescode2 i.rescode3), dr(19)
          i.GENDER _IGENDER_1-2 (naturally coded; _IGENDER_1 omitted)
          i.educself1 _Ieducself1_0-1 (naturally coded; _Ieducself1_0 omitted)
          i.educself2 _Ieducself2_0-1 (naturally coded; _Ieducself2_0 omitted)
          i.educself3 _Ieducself3_0-1 (naturally coded; _Ieducself3_0 omitted)
          i.educself4 _Ieducself4_0-1 (naturally coded; _Ieducself4_0 omitted)
          i.educself5 _Ieducself5_0-1 (naturally coded; _Ieducself5_0 omitted)
          i.educself6 _Ieducself6_0-1 (naturally coded; _Ieducself6_0 omitted)
          i.educself7 _Ieducself7_0-1 (naturally coded; _Ieducself7_0 omitted)
          i.educself8 _Ieducself8_0-1 (naturally coded; _Ieducself8_0 omitted)
          i.educself9 _Ieducself9_0-1 (naturally coded; _Ieducself9_0 omitted)
          i.bemba_spaek~g _Ibemba_spa_0-1 (naturally coded; _Ibemba_spa_0 omitted)
          i.tonga_speak~g _Itonga_spe_0-1 (naturally coded; _Itonga_spe_0 omitted)
          i.northwestern _Inorthwest_0-1 (naturally coded; _Inorthwest_0 omitted)
          i.barotse_group _Ibarotse_g_0-1 (naturally coded; _Ibarotse_g_0 omitted)
          i.nyanja_spea~g _Inyanja_sp_0-1 (naturally coded; _Inyanja_sp_0 omitted)
          i.mambwe_group _Imambwe_gr_0-1 (naturally coded; _Imambwe_gr_0 omitted)
          i.tumbuka_spe~g _Itumbuka_s_0-1 (naturally coded; _Itumbuka_s_0 omitted)
          i.other_group _Iother_gro_0-1 (naturally coded; _Iother_gro_0 omitted)
          i.marital1 _Imarital1_0-1 (naturally coded; _Imarital1_0 omitted)
          i.marital2 _Imarital2_0-1 (naturally coded; _Imarital2_0 omitted)
          i.marital3 _Imarital3_0-1 (naturally coded; _Imarital3_0 omitted)
          i.marital4 _Imarital4_0-1 (naturally coded; _Imarital4_0 omitted)
          i.marital5 _Imarital5_0-1 (naturally coded; _Imarital5_0 omitted)
          i.income11 _Iincome11_0-1 (naturally coded; _Iincome11_0 omitted)
          i.income12 _Iincome12_0-1 (naturally coded; _Iincome12_0 omitted)
          i.income13 _Iincome13_0-1 (naturally coded; _Iincome13_0 omitted)
          i.income14 _Iincome14_0-1 (naturally coded; _Iincome14_0 omitted)
          i.income15 _Iincome15_0-1 (naturally coded; _Iincome15_0 omitted)
          i.income16 _Iincome16_0-1 (naturally coded; _Iincome16_0 omitted)
          i.income17 _Iincome17_0-1 (naturally coded; _Iincome17_0 omitted)
          i.income18 _Iincome18_0-1 (naturally coded; _Iincome18_0 omitted)
          i.income19 _Iincome19_0-1 (naturally coded; _Iincome19_0 omitted)
          i.income21 _Iincome21_0-1 (naturally coded; _Iincome21_0 omitted)
          i.income22 _Iincome22_0-1 (naturally coded; _Iincome22_0 omitted)
          i.income23 _Iincome23_0-1 (naturally coded; _Iincome23_0 omitted)
          i.income24 _Iincome24_0-1 (naturally coded; _Iincome24_0 omitted)
          i.income25 _Iincome25_0-1 (naturally coded; _Iincome25_0 omitted)
          i.income26 _Iincome26_0-1 (naturally coded; _Iincome26_0 omitted)
          i.income27 _Iincome27_0-1 (naturally coded; _Iincome27_0 omitted)
          i.income28 _Iincome28_0-1 (naturally coded; _Iincome28_0 omitted)
          i.income29 _Iincome29_0-1 (naturally coded; _Iincome29_0 omitted)
          i.hhincome1 _Ihhincome1_0-1 (naturally coded; _Ihhincome1_0 omitted)
          i.hhincome2 _Ihhincome2_0-1 (naturally coded; _Ihhincome2_0 omitted)
          i.hhincome3 _Ihhincome3_0-1 (naturally coded; _Ihhincome3_0 omitted)
          i.hhincome4 _Ihhincome4_0-1 (naturally coded; _Ihhincome4_0 omitted)
          i.hhincome5 _Ihhincome5_0-1 (naturally coded; _Ihhincome5_0 omitted)
          i.hhincome6 _Ihhincome6_0-1 (naturally coded; _Ihhincome6_0 omitted)
          i.resid_incom1 _Iresid_inc_0-1 (naturally coded; _Iresid_inc_0 omitted)
          i.resid_incom2 _Iresid_inca0-1 (naturally coded; _Iresid_inca0 omitted)
          i.resid_incom3 _Iresid_incb0-1 (naturally coded; _Iresid_incb0 omitted)
          i.roof1 _Iroof1_0-1 (naturally coded; _Iroof1_0 omitted)
          i.roof2 _Iroof2_0-1 (naturally coded; _Iroof2_0 omitted)
          i.roof3 _Iroof3_0-1 (naturally coded; _Iroof3_0 omitted)
          i.roof4 _Iroof4_0-1 (naturally coded; _Iroof4_0 omitted)
          i.floor1 _Ifloor1_0-1 (naturally coded; _Ifloor1_0 omitted)
          i.floor2 _Ifloor2_0-1 (naturally coded; _Ifloor2_0 omitted)
          i.floor3 _Ifloor3_0-1 (naturally coded; _Ifloor3_0 omitted)
          i.floor4 _Ifloor4_0-1 (naturally coded; _Ifloor4_0 omitted)
          i.floor5 _Ifloor5_0-1 (naturally coded; _Ifloor5_0 omitted)
          i.walls1 _Iwalls1_0-1 (naturally coded; _Iwalls1_0 omitted)
          i.walls2 _Iwalls2_0-1 (naturally coded; _Iwalls2_0 omitted)
          i.walls3 _Iwalls3_0-1 (naturally coded; _Iwalls3_0 omitted)
          i.ELEC _IELEC_0-1 (naturally coded; _IELEC_0 omitted)
          i.PLUMB _IPLUMB_0-1 (naturally coded; _IPLUMB_0 omitted)
          i.MOBILE _IMOBILE_0-1 (naturally coded; _IMOBILE_0 omitted)
          i.RADIO _IRADIO_0-1 (naturally coded; _IRADIO_0 omitted)
          i.TELE _ITELE_0-1 (naturally coded; _ITELE_0 omitted)
          i.REFRIG _IREFRIG_0-1 (naturally coded; _IREFRIG_0 omitted)
          i.CHARCBRAZ_AST _ICHARCBRAZ_0-1 (naturally coded; _ICHARCBRAZ_0 omitted)
          i.ELECTHOTPL~ST _IELECTHOTP_0-1 (naturally coded; _IELECTHOTP_0 omitted)
          i.rescode1 _Irescode1_0-1 (naturally coded; _Irescode1_0 omitted)
          i.rescode2 _Irescode2_0-1 (naturally coded; _Irescode2_0 omitted)
          i.rescode3 _Irescode3_0-1 (naturally coded; _Irescode3_0 omitted)
          note: _Ieducself1_1 omitted because of collinearity.
          note: _Iother_gro_1 omitted because of collinearity.
          note: _Imarital4_1 omitted because of collinearity.
          note: _Iincome16_1 omitted because of collinearity.
          note: _Iincome22_1 omitted because of collinearity.
          note: _Ihhincome1_1 omitted because of collinearity.
          note: _Ihhincome6_1 omitted because of collinearity.
          note: _Iresid_inca1 omitted because of collinearity.
          note: _Iresid_incb1 omitted because of collinearity.
          note: _Iroof2_1 omitted because of collinearity.
          note: _Ifloor5_1 omitted because of collinearity.
          note: _Iwalls3_1 omitted because of collinearity.
          note: _Irescode1_1 omitted because of collinearity.
          note: _Ieducself1_1 omitted because of collinearity.
          note: _Iother_gro_1 omitted because of collinearity.
          note: _Imarital4_1 omitted because of collinearity.
          note: _Iincome16_1 omitted because of collinearity.
          note: _Iincome22_1 omitted because of collinearity.
          note: _Ihhincome1_1 omitted because of collinearity.
          note: _Ihhincome6_1 omitted because of collinearity.
          note: _Iresid_inca1 omitted because of collinearity.
          note: _Iresid_incb1 omitted because of collinearity.
          note: _Iroof2_1 omitted because of collinearity.
          note: _Ifloor5_1 omitted because of collinearity.
          note: _Iwalls3_1 omitted because of collinearity.
          note: _Irescode1_1 omitted because of collinearity.
          note: _Ieducself1_1 omitted because of collinearity.
          note: _Iother_gro_1 omitted because of collinearity.
          note: _Imarital4_1 omitted because of collinearity.
          note: _Iincome16_1 omitted because of collinearity.
          note: _Iincome22_1 omitted because of collinearity.
          note: _Ihhincome1_1 omitted because of collinearity.
          note: _Ihhincome6_1 omitted because of collinearity.
          note: _Iresid_inca1 omitted because of collinearity.
          note: _Iresid_incb1 omitted because of collinearity.
          note: _Iroof2_1 omitted because of collinearity.
          note: _Ifloor5_1 omitted because of collinearity.
          note: _Iwalls3_1 omitted because of collinearity.
          note: _Irescode1_1 omitted because of collinearity.

          initial values not feasible
          r(1400);

          end of do-file

          r(1400);

          .

          Comment


          • #6


            Thank you very much. Your solution worked for me George Ford

            Comment


            • #7
              Hello,

              I want to know the requirements or interpretation of the artrho and rho in the mvprobit output? What does it mean and how do we make sense of them. George Ford @Clyde Schechter
              Click image for larger version

Name:	Screenshot 2024-08-09 141208.png
Views:	1
Size:	28.9 KB
ID:	1761170

              Comment


              • #8
                These are correlations (rho) and transformations of rho (atrho) of the residuals between models. If they were all insignificant, then it basically means you don't gain anything by estimating the models jointly.


                HTML Code:
                https://journals.sagepub.com/doi/pdf/10.1177/1536867X1101100211

                Comment


                • #9
                  George Ford Clyde Schechter Thanks for your helpful contributions. Key point: my "baby", -mvprobit-, was written 2 decades ago! When I have some time (ha ha), I'll incorporate the ''fix' George proposes to handle factor variables. (But with -xi- prefix, the program remains functional, as Clyde points out.) The SJ article is available for free from the SJ website.

                  Comment


                  • #10
                    Thanks Stephen for the update.

                    Comment


                    • #11
                      With thanks, as ever, to KitBaum, a revised version of the -mvprobit- ado-file has been posted on SSC. Following George Ford 's suggestions, it can now handle factor variables(and time series) variable notation and the version is bumped up to 12 (from 8.2) accordingly. Let's keep this 2-decade show on the road. Happy New Year!

                      Code:
                      . mvprobit (private = years logptax loginc i.school) (vote = years logptax loginc i.school), dr(50)
                      
                      Iteration 0:  Log likelihood = -86.241876  
                      Iteration 1:  Log likelihood = -84.902859  
                      Iteration 2:  Log likelihood = -84.745687  
                      Iteration 3:  Log likelihood = -84.719188  
                      Iteration 4:  Log likelihood = -84.714289  
                      Iteration 5:  Log likelihood = -84.713286  
                      Iteration 6:  Log likelihood =  -84.71313  
                      Iteration 7:  Log likelihood = -84.713107  
                      Iteration 8:  Log likelihood = -84.713103  
                      
                      Multivariate probit (MSL, # draws = 50)                 Number of obs =     95
                                                                              Wald chi2(8)  =  12.45
                      Log likelihood = -84.713103                             Prob > chi2   = 0.1322
                      
                      ------------------------------------------------------------------------------
                                   | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
                      -------------+----------------------------------------------------------------
                      private      |
                             years |  -.0106749   .0252096    -0.42   0.672    -.0600848     .038735
                           logptax |  -.1936626    .722993    -0.27   0.789    -1.610703    1.223378
                            loginc |   .3289985   .5886069     0.56   0.576    -.8246498    1.482647
                          1.school |  -3.989768    177.022    -0.02   0.982    -350.9465    342.9669
                             _cons |  -3.049057   5.153914    -0.59   0.554    -13.15054    7.052429
                      -------------+----------------------------------------------------------------
                      vote         |
                             years |  -.0129805   .0149901    -0.87   0.387    -.0423606    .0163995
                           logptax |   -1.24267   .6062096    -2.05   0.040    -2.430819   -.0545213
                            loginc |   1.259882   .4466695     2.82   0.005      .384426    2.135338
                          1.school |   1.712162   .8188277     2.09   0.037     .1072895    3.317035
                             _cons |  -3.611772   4.376047    -0.83   0.409    -12.18867    4.965123
                      -------------+----------------------------------------------------------------
                          /atrho21 |  -.1726963   .2390213    -0.72   0.470    -.6411694    .2957769
                      -------------+----------------------------------------------------------------
                             rho21 |  -.1709997   .2320321    -0.74   0.461    -.5656953    .2874431
                      ------------------------------------------------------------------------------





                      Comment

                      Working...
                      X