Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
修正约束mlogit stata_Stata_Mlogit - Fatal编程技术网

修正约束mlogit stata

修正约束mlogit stata,stata,mlogit,Stata,Mlogit,所以我有点麻烦了。我需要对处于状态的数据施加约束,以运行mlogit,但它不断声明尚未找到等式。有人能帮忙吗 由于您没有提供完整的输出或MCVE,因此很难确定到底出了什么问题。错误303表示: 您引用了对应于 无法找到的等式或结果 这意味着您可能通过引用数值而不是Stata用于标记每个方程的相应值标签来错误地定义约束 而不是 constraint 1 [insure=3]:age =-1*[insure=2]:age 试着这样做: . webuse sysdsn1 (Health insura

所以我有点麻烦了。我需要对处于状态的数据施加约束,以运行mlogit,但它不断声明尚未找到等式。有人能帮忙吗


由于您没有提供完整的输出或MCVE,因此很难确定到底出了什么问题。错误303表示:

您引用了对应于 无法找到的等式或结果

这意味着您可能通过引用数值而不是Stata用于标记每个方程的相应值标签来错误地定义约束

而不是

constraint 1 [insure=3]:age =-1*[insure=2]:age
试着这样做:

. webuse sysdsn1
(Health insurance data)

. label list insure 
insure:
           1 Indemnity
           2 Prepaid
           3 Uninsure

. constraint 1 [Uninsure]:age =-1*[Prepaid]:age

. mlogit insure age male i.site, constraints(1) nolog

Multinomial logistic regression                 Number of obs     =        615
                                                Wald chi2(7)      =      20.43
Log likelihood = -544.32915                     Prob > chi2       =     0.0047

 ( 1)  [Prepaid]age + [Uninsure]age = 0
------------------------------------------------------------------------------
      insure |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Indemnity    |  (base outcome)
-------------+----------------------------------------------------------------
Prepaid      |
         age |  -.0054932   .0046759    -1.17   0.240    -.0146579    .0036714
        male |   .4673414   .1980637     2.36   0.018     .0791436    .8555392
             |
        site |
          2  |  -.0030463   .2045162    -0.01   0.988    -.4038907     .397798
          3  |  -.4001761   .2179144    -1.84   0.066    -.8272804    .0269282
             |
       _cons |   .1940359   .2672973     0.73   0.468    -.3298572     .717929
-------------+----------------------------------------------------------------
Uninsure     |
         age |   .0054932   .0046759     1.17   0.240    -.0036714    .0146579
        male |   .4015065   .3642457     1.10   0.270    -.3124019    1.115415
             |
        site |
          2  |  -1.192478   .4670081    -2.55   0.011    -2.107797   -.2771591
          3  |  -.1393011   .3592712    -0.39   0.698    -.8434596    .5648575
             |
       _cons |  -1.868834   .3596923    -5.20   0.000    -2.573818    -1.16385
------------------------------------------------------------------------------

欢迎来到堆栈溢出!请阅读并了解如何创建一个。然后相应地编辑你的问题。接得好。虽然我怀疑我们永远也不会知道这是否是问题所在。@PearlySpiner使用约束的第一个版本将产生相同的303错误,但我同意这不是确定的。