进一步补充,本人使用了经典的Car choice data,按照上述代码思路进行了IIA检验的估计,试图检验是否是本文采用的数据有误,但同样出现了报错情况,如下:
use
https://www.stata-press.com/data/r18/carchoice
(Car choice data)
. cmset consumerid car
note: alternatives are unbalanced across choice sets; choice sets of different
sizes found.
Case ID variable: consumerid
Alternatives variable: car
. iia purchase dealers,group(consumerid) code(car)
Iteration 0: log likelihood = -1081.6452
Iteration 1: log likelihood = -1025.6474
Iteration 2: log likelihood = -1025.0791
Iteration 3: log likelihood = -1025.0788
Conditional (fixed-effects) logistic regression Number of obs = 3160
LR chi2(1) = 184.94
Prob > chi2 = 0.0000
Log likelihood = -1025.0788 Pseudo R2 = 0.0827
------------------------------------------------------------------------------
purchase | Coefficient Std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
dealers | .1786406 .0140871 12.68 0.000 .1510304 .2062507
------------------------------------------------------------------------------
Hausman's test for assumption of "Independence of Irrelevant Alternatives"
Category #obs Hausman df p
-----------------------------------------
option nodisplay not allowed
r(198);