Announcement

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

  • How to test if the sum of two parameters are zero when we use mlogit command?

    Hi I want to know how to test if the sum of two parameters are zero in the mlogit context.

    <Notations>
    y: the nominal dependent variable having three values, 1, 2, and 3
    x1, x2: the unit specific regressors (They are alternative-invariant. Thus, we have two parameters for each regressor)
    d1: a dummy variable

    <Code>
    Code:
    mlogit y x1 x2 i.d1#c.x1
    In this situation, I am wondering how to test the sum of the coefficients of x1 and i.d1#c.x1.

    I tried to the following commands.
    Code:
    testparm x1 i.d1#c.x1, equal
           Constraint 1 dropped
    
               chi2(  0) =       .
             Prob > chi2 =         .
    
    testparm [2]x1 [2]i.d1#c.x1, equal
    varlist required
    In addition to the above commands, I tried many other command but I was not able to run the test.
    How can I test if the sum of two parameters are zero in multinomial logit context?

    Thank you for your time spent to read this question.

  • #2
    I found the solution:
    Code:
    gen interaction = d1*x1
    mlogit y x1 x2 interaction
    test [2]x1+[2]interaction=0
    Last edited by Minchul Park; 20 Nov 2020, 12:25.

    Comment


    • #3
      What you are testing in post #2 is whether the coefficient of x1 is the negative of the coefficient of interaction. That is different than testing equality as you attempt in post #1

      More to the point, you should be able to construct your test command without manually creating the interaction, which is almost always a bad idea. Perhaps if you were to run
      Code:
      mlogit y x1 x2 i.d1#c.x1
      mlogit, coeflegend
      the output from the second mlogit command would tell you the coefficient names to use in the test command.

      Comment


      • #4


        A couple of comments. The first one is that you are testing for a single restriction, albeit being a linear combination of two parameters. Tests of single restrictions ought to be t-tests, or z tests like in this case. For linear combination this is done with lincom. Of course we could argue that the z test would be equivalent to taking the squared root of the chi-squared that the command test provides and that both would yield the same result, and that is correct.

        The second comment is that with mlogit you will have results presented in equation groups, where each group is an alternative that is not the benchmark So you would have to specify the "equation" name before the parameter at hand. Also remember that since one of the variables is a factor variable, you have to specify the category for the coefficient you want to use.

        In summary, consider the following
        Code:
        . webuse sysdsn1, clear
        (Health insurance data)
        
        . mlogit insure c.age##i.male, nolog
        
        Multinomial logistic regression                 Number of obs     =        615
                                                        LR chi2(6)        =      14.28
                                                        Prob > chi2       =     0.0267
        Log likelihood = -548.71567                     Pseudo R2         =     0.0128
        
        ------------------------------------------------------------------------------
              insure |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
        Indemnity    |  (base outcome)
        -------------+----------------------------------------------------------------
        Prepaid      |
                 age |  -.0172658    .007056    -2.45   0.014    -.0310952   -.0034364
              1.male |  -.7778813   .6779148    -1.15   0.251     -2.10657    .5508073
                     |
          male#c.age |
                  1  |   .0279221   .0140854     1.98   0.047     .0003153    .0555289
                     |
               _cons |   .5752139   .3194784     1.80   0.072    -.0509524     1.20138
        -------------+----------------------------------------------------------------
        Uninsure     |
                 age |  -.0007572   .0131134    -0.06   0.954     -.026459    .0249446
              1.male |    1.03223   1.227831     0.84   0.401    -1.374274    3.438733
                     |
          male#c.age |
                  1  |  -.0128446   .0265154    -0.48   0.628    -.0648138    .0391246
                     |
               _cons |  -1.951252   .6183622    -3.16   0.002    -3.163219   -.7392841
        ------------------------------------------------------------------------------
        
        . lincom [Prepaid]1.male#c.age + [Prepaid]age
        
         ( 1)  [Prepaid]age + [Prepaid]1.male#c.age = 0
        
        ------------------------------------------------------------------------------
              insure |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                 (1) |   .0106563   .0121906     0.87   0.382    -.0132369    .0345495
        ------------------------------------------------------------------------------
        Alfonso Sanchez-Penalver

        Comment


        • #5
          William Lisowski Alfonso Sánchez-Peñalver Thank you for your very detailed and informative comments. Although I missed a lot of things to test what I want, I was able to achieve my purpose properly thanks to your contribution. Thank you again.

          Comment

          Working...
          X