0
我從一個離散選擇實驗分析數據,我想不出有什麼重物mlogit
使用時,我指定weights
對由R使用mlogit
下面的代碼有什麼重物:
mlogit(formula = RES ~ -1 + V1 + V2, data = data,
reflevel = 1, rpar = c(V1 = "n", V2 = "n"), weights = Weight1, correlation = FALSE,
halton = NA, panel = TRUE, seed = 1234567890, method = "bfgs")
產生以下估計:
Frequencies of alternatives:
1 2
0.22987 0.77013
bfgs method
19 iterations, 0h:15m:34s
g'(-H)^-1g = 4.29E-08
gradient close to zero
Coefficients :
Estimate Std. Error t-value Pr(>|t|)
V1 0.859789 0.019076 45.072 < 2.2e-16 ***
V2 2.705395 0.039205 69.006 < 2.2e-16 ***
sd.V1 0.483573 0.023502 20.576 < 2.2e-16 ***
sd.V2 3.916796 0.062557 62.612 < 2.2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Log-Likelihood: -9297.9
random coefficients
Min. 1st Qu. Median Mean 3rd Qu. Max.
V1 -Inf 0.53362451 0.8597892 0.8597892 1.185954 Inf
V2 -Inf 0.06355681 2.7053955 2.7053955 5.347234 Inf
然而,當我運行在Stata相同的混合邏輯模型,下面的命令:
mixlogit res [pweight=weight1], group(str) id(id) rand(V1 V2) ln(0)
給了我下面的估計:
Mixed logit model Number of obs = 41,154
Wald chi2(2) = 395.55
Log likelihood = -9089.7906 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
| Robust
res | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
Mean |
V1 | 1.207748 .0774815 15.59 0.000 1.055887 1.359608
V2 | 4.458814 .2356245 18.92 0.000 3.996998 4.920629
-------------+----------------------------------------------------------------
SD |
V1 | 1.107036 .0765884 14.45 0.000 .9569252 1.257146
V2 | 4.444472 .3586858 12.39 0.000 3.741461 5.147483
------------------------------------------------------------------------------
無論權重方案我在Stata使用(pweight
,iweight
,或者fweight
),我得到了類似的結果,決不是R給我的結果。
但是,當我在任一程序中運行未加權的混合logit模型時,我得到相同的估計值。這使得我的權重是顯而易見的問題,但我無法弄清楚R在做什麼。
幫助?