0

I am analyzing data from a discrete choice experiment, and I cannot figure out what weights mlogit uses when I specify weights

The following code:

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")

produces the following estimates:

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

However, when I run the same mixed logit model in Stata, the following command:

mixlogit res [pweight=weight1], group(str) id(id) rand(V1 V2) ln(0)

gives me the following estimates:

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
------------------------------------------------------------------------------

Whatever weighting scheme I use in Stata (pweight, iweight, or fweight), I get similar results, and never the results that R gives me.

However, when I run the unweighted mixed logit model in either program, I get the same estimates. This makes me thing the weighting is the obvious issue, but I can't figure out what R is doing.

Help?

TheChainsOfMarkov
  • 323
  • 1
  • 2
  • 11

1 Answers1

2

This may only be seen by me, but in case anyone ever runs into this, the problem wasn't the weighting. It was the fact that the stop conditions in the R command (R = 10, tol = 10) were too lenient. If you set R to larger and tol to smaller, the two estimates converge.

TheChainsOfMarkov
  • 323
  • 1
  • 2
  • 11