Announcement

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

  • How to compare coefficients (variable) across different gologit2 models?

    How can I compare an effect of one independent ordinal variable in two partial proportional odds models fitted with the gologit2 command?
    Two models with different dependent variables are fitted (gologit2 with autofit option). I now want to test if one independent variable (an ordinal variable with 3 categories) has a stronger effect in one model compared to the other model.
    Therefore I used the suest command:
    “suest m1 m2”
    “test [m1_panel1]1.independetvar = [m2_panel1]1.independetvar”

    Is there a way I can compare the impact of the independent variable without addressing the single categories of the variable? For example like this:
    “test [m1_panel1]independetvar = [m2_panel1]independetvar” (doesn't work)


    Or is there another way I can compare for stronger effect of a variable in gologit2 models with different dependent variables?

  • #2
    I don't really like doing this. For one thing, even if added variables are totally uncorrelated with current variables, coefficients can change as the model changes. I think comparisons of models with totally different vars could be problematic too. (This would be true for plain old logit and ologit too.) See, for example,

    http://www.stata-journal.com/article...article=st0208

    With gologit2, I think it would further get complicated if vars tested were not constrained to meet the PO assumption and/or if the constraints imposed were not the same in each model.

    If you are bound and determined to do it anyway, my guess is that it would be something like

    Code:
    test [m1_panel1]1.independetvar = [m2_panel1]1.independetvar
    test [m1_panel1]2.independetvar = [m2_panel1]2.independetvar, accum
    test [m1_panel1]3.independetvar = [m2_panel1]3.independetvar, accum
    I haven't tried it though. And again, I don't recommend it in the first place.

    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    Stata Version: 16.1MP (2 processor)

    EMAIL: rwilliam@ND.Edu
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Hi there,

      I also ran diverse gologit2 models which contain the same variables but refer to different years (trend design). And I wonder, how to compare the coefficients across the models?
      I read the Long/Freese chapter 7 about models for ordinal outcomes and as I understood them, mchange should work with gologit2!?

      So I tried to estimate marginal effects (first with "mchange", then with "margins") but every time I got the error message: "too few variables specified, dependent variable has 3 outcomes and so you must specify 3 new variables, or you can use the outcome() option and specify variables one at a time".

      Then I tried "margeff" and got teh error message: "-margeff- does not work with gologit2; use -mfx- instead".

      "mfx" -->"too few variables specified, dependent variable has 3 outcomes and so you must specify 3 new variables, or you can use the outcome() option and specify variables one at a time".

      I am a bit helpless and don´t see my mistake.

      I tried the mchange command with the same variables with an ologit and mlogit model and it worked.

      Any ideas?

      Merry Christmas,
      Annabell


      Comment


      • #4
        Make sure you have the most current versions of spost13 and gologit2. If problems persist show the exact commands you gave and the Stata output. Also indicate what version of Stata you are using. Use code tags when you post the commands and output (see point 12 of the FAQ). If possible, a replicable example would be nice.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        Stata Version: 16.1MP (2 processor)

        EMAIL: rwilliam@ND.Edu
        WWW: https://www3.nd.edu/~rwilliam

        Comment


        • #5
          I am using Stata 13.1 and have just reinstalled gologit2 and spost13.

          My dependent variable (swtie) has three outcomes, the independent variables describe different combinations of sex in dyads, where boy_boy is the reference category.

          Here ist a code example which works:
          Code:
          mlogit swtie boy_girl girl_boy girl_girl, rrr base(0)
          Output:
          Code:
          Iteration 0:   log likelihood = -21472.822  
          Iteration 1:   log likelihood =  -18218.94  
          Iteration 2:   log likelihood = -17876.301  
          Iteration 3:   log likelihood = -17864.654  
          Iteration 4:   log likelihood = -17864.608  
          Iteration 5:   log likelihood = -17864.608  
          
          Multinomial logistic regression                   Number of obs   =      27499
                                                            LR chi2(6)      =    7216.43
                                                            Prob > chi2     =     0.0000
          Log likelihood = -17864.608                       Pseudo R2       =     0.1680
          
          ------------------------------------------------------------------------------
                 swtie |        RRR   Std. Err.      z    P>|z|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
          no_tie       |  (base outcome)
          -------------+----------------------------------------------------------------
          weak_tie     |
              boy_girl |   .1031048   .0074358   -31.50   0.000     .0895142     .118759
              girl_boy |    .109595   .0077249   -31.37   0.000     .0954537    .1258312
             girl_girl |   1.373661   .0578242     7.54   0.000     1.264877    1.491801
                 _cons |   .3730936   .0107989   -34.06   0.000     .3525173    .3948708
          -------------+----------------------------------------------------------------
          strong_tie   |
              boy_girl |    .039942   .0041208   -31.21   0.000     .0326296    .0488932
              girl_boy |    .039319   .0040931   -31.09   0.000      .032062    .0482184
             girl_girl |   1.377719   .0558207     7.91   0.000     1.272543    1.491587
                 _cons |   .4167995   .0115941   -31.46   0.000     .3946838    .4401544
          ------------------------------------------------------------------------------
          Code:
          mchange boy_girl girl_boy girl_girl, amount(binary)
          
          mlogit: Changes in Pr(y) | Number of obs = 27499
          
          Expression: Pr(swtie), predict(outcome())
          
                       |    no tie   weak tie  strong ~e
          -------------+---------------------------------
          boy girl     |                                
                0 to 1 |     0.323     -0.145     -0.178
               p-value |     0.000      0.000      0.000
          girl boy     |                                
                0 to 1 |     0.321     -0.143     -0.178
               p-value |     0.000      0.000      0.000
          girl girl    |                                
                0 to 1 |    -0.051      0.026      0.025
               p-value |     0.000      0.000      0.000
          
          Average predictions
          
                       |    no tie   weak tie  strong ~e
          -------------+---------------------------------
            Pr(y|base) |     0.724      0.136      0.140
          Then I ran a gologit2 model with the following code:
          Code:
          gologit2 swtie boy_girl girl_boy girl_girl, autofit or
          
          ------------------------------------------------------------------------------
          Testing parallel lines assumption using the .05 level of significance...
          
          Step  1:  Constraints for parallel lines are not imposed for
                    boy_girl (P Value = 0.00128)
                    girl_boy (P Value = 0.00014)
                    girl_girl (P Value = 0.00314)
          
          If you re-estimate this exact same model with gologit2, instead
          of autofit you can save time by using the parameter
          
          npl
          
          ------------------------------------------------------------------------------
          
          Generalized Ordered Logit Estimates               Number of obs   =      27499
                                                            LR chi2(6)      =    7216.43
                                                            Prob > chi2     =     0.0000
          Log likelihood = -17864.608                       Pseudo R2       =     0.1680
          
          ------------------------------------------------------------------------------
                 swtie | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
          no_tie       |
              boy_girl |    .069776   .0041924   -44.31   0.000     .0620245    .0784963
              girl_boy |   .0725127   .0042966   -44.28   0.000     .0645621    .0814424
             girl_girl |   1.375802   .0461184     9.52   0.000     1.288317    1.469228
                 _cons |    .789893   .0179398   -10.38   0.000     .7555027    .8258486
          -------------+----------------------------------------------------------------
          weak_tie     |
              boy_girl |   .0528125   .0054313   -28.60   0.000     .0431716    .0646064
              girl_boy |   .0518678   .0053825   -28.51   0.000      .042322    .0635667
             girl_girl |   1.250732   .0479944     5.83   0.000     1.160115    1.348427
                 _cons |   .3035477   .0080993   -44.68   0.000     .2880814    .3198444
          ------------------------------------------------------------------------------
          After the gologit2 model was estimated, I got the following error message:
          Code:
          mchange boy_girl girl_boy girl_girl, amount(binary)
          
          too few variables specified
          swtie has 3 outcomes and so you must specify 3 new variables, or
          you can use the outcome() option and specify variables one at a time
          Last edited by Annabell Zentarra; 25 Dec 2015, 15:21.

          Comment


          • #6
            I still suspect a problem with your program installation, but without having your data or a replicable example I can't tell. This code works for me in both Stata 13 and 14. What happens when you run it?

            Code:
            webuse nhanes2f,clear
            gologit2 health female black, auto or
            mchange female black, amount(binary)

            Also, what do the which commands show you? I get

            Code:
            . which gologit2
            c:\ado\plus\g\gologit2.ado
            *! version 3.1.0 12may2015  Richard Williams, rwilliam@nd.edu
            
            . which mchange
            c:\ado\plus\m\mchange.ado
            *! version 3.0.3 xx2015-04-18 | long freese | stat(ci p) allowed
            Incidentally, gologit2 now supports factor variables, So, you should't be doing this boy_girl girl_boy girl_girl bit. You should use factor variable notation instead. Otherwise Stata won't realize that if a case is coded 1 on boy_girl it can't also be coded 1 on girl_boy. Instead do something like

            gologit2 y i.gender1 i.gender2 i.gender1#i.gender2

            Or maybe something like

            gologit2 y i.dyadgender

            where dyadgender is coded 1-4 for each of the 4 types of dyads.

            If you don't understand factor variables, type -help fvvarlist-.

            If none of this solves your problem -- if you can give me a replicable example, or can share your data with me, I will try to take a closer look at it.
            -------------------------------------------
            Richard Williams, Notre Dame Dept of Sociology
            Stata Version: 16.1MP (2 processor)

            EMAIL: rwilliam@ND.Edu
            WWW: https://www3.nd.edu/~rwilliam

            Comment


            • #7
              You are absolutely right. Somehow, I was still working with an old version of gologit2, even though I had reinstalled it.
              Now, after an update to the newest version of gologit2 everything works fine!

              After the reinstallation, I did not consider the problem to be based on programm installation and was searching for other "more complicated" mistakes.

              Thanks for your advice concerning factor variables. I will read the flie and implement them in my analysis.
              Thanks a lot for your help!

              Comment


              • #8
                For more on margins and factor variables, you may wish to see

                http://www3.nd.edu/~rwilliam/stats/Margins01.pdf (highlights version)

                Model 4 explains what is wrong with the way you are currently handling dyadic gender.

                The full article is available for free at

                http://www.stata-journal.com/article...article=st0260

                Incidentally, gologit2 and oglm (as well as some other commands) both work a little better with margins if you have Stata 14:

                http://www.statalist.org/forums/foru...ailable-on-ssc

                -------------------------------------------
                Richard Williams, Notre Dame Dept of Sociology
                Stata Version: 16.1MP (2 processor)

                EMAIL: rwilliam@ND.Edu
                WWW: https://www3.nd.edu/~rwilliam

                Comment


                • #9
                  Hi, I have developed a gologit2 with autofit option. My dependent variable is Prudence coded as 1 low, 2 neutral, 3 high. I obtained two model 1 and 2, if an independent variable like income have a negative coefficient in model 1 (low prudence) means that an increase of income increases the likelihood of being in the current or a lower category?

                  Comment


                  • #10
                    Hi,
                    I want to compare coefficients of ordered logit between two groups. Any suggestions, please? I'm also interested in comparing coefficients across two equations.

                    Comment

                    Working...
                    X