Stata 15 help for asmixlogit

[R] asmixlogit -- Alternative-specific mixed logit regression


asmixlogit depvar [indepvars] [if] [in] [weight], case(caseid) [options]

depvar equal to 1 identifies the outcome or chosen alternative, whereas a 0 indicates the alternatives that were not chosen. Only one alternative may be chosen for each case.

indepvars specifies the alternative-specific covariates that have fixed coefficients.

options Description ------------------------------------------------------------------------- Model * case(caseid) use variable caseid to identify cases * alternatives(altvar) use altvar to identify the alternatives available for each case casevars(varlist) case-specific variables noconstant suppress the alternative-specific constant terms random(varlist[, distribution]) specify variables that are to have random coefficients and the coefficients' distribution constraints(constraints) apply specified linear constraints collinear keep collinear variables

Model 2 corrmetric(metric) correlation metric for correlated random coefficients basealternative(#|lbl|str) alternative used for normalizing location altwise use alternativewise deletion instead of casewise deletion

SE/Robust vce(vcetype) vcetype may be oim, robust, cluster clustvar, opg, bootstrap, or jackknife

Reporting level(#) set confidence level; default is level(95) nocnsreport do not display constraints display_options control columns and column formats, row spacing, line width, display of omitted variables and base and empty cells, and factor-variable labeling

Integration intmethod(seqspec) specify point set for Monte Carlo integration intpoints(#) specify number of points in each sequence intburn(#) specify starting index in the Hammersley or Halton sequence intseed(#) specify random-number seed for pseudorandom sequence favor(speed|space) favor speed or space when generating integration points

Maximization maximize_options control the maximization process; seldom used

coeflegend display legend instead of statistics -------------------------------------------------------------------------

metric Description ------------------------------------------------------------------------- correlation standard deviation and correlation; the default covariance variance and covariance cholesky Cholesky factor -------------------------------------------------------------------------

distribution Description ------------------------------------------------------------------------- normal Gaussian-distributed random coefficients; the default correlated correlated Gaussian-distributed random coefficients lnormal lognormal distributed random coefficients tnormal truncated normal distributed random coefficients uniform uniform distributed random coefficients triangle triangular distributed random coefficients -------------------------------------------------------------------------

seqspec is

seqtype [, antithetics | mantithetics]

seqtype Description ------------------------------------------------------------------------- hammersley Hammersley point set; the default halton Halton point set random uniform pseudorandom point set -------------------------------------------------------------------------

* case(casevar) is required. alternatives(altvar) is required to estimate alternative-specific constants or if case-specific variables are specified. indepvars and varlist may contain factor variables; see fvvarlist. bootstrap, by, jackknife, statsby, and svy are allowed; see prefix. Weights are not allowed with the bootstrap prefix. vce() and weights are not allowed with the svy prefix. fweights, iweights, and pweights are allowed; see weights. coeflegend does not appear in the dialog box. See [R] asmixlogit postestimation for features available after estimation.


Statistics > Categorical outcomes > Mixed logit model


asmixlogit fits an alternative-specific mixed logit model, also known as a mixed multinomial logit model or random-parameter logit model, that uses random coefficients to model the correlation of choices across alternatives. The random coefficients are on variables that vary across both cases and alternatives known as alternative-specific variables. The correlation of choices across alternatives relaxes the independence of irrelevant alternatives (IIA) property imposed by the conventional multinomial logit model fit by mlogit and the alternative-specific conditional logit model fit by asclogit.


+-------+ ----+ Model +------------------------------------------------------------

case(caseid) specifies the variable that identifies each case. This variable identifies the individuals or entities making a choice. case() is required.

alternatives(altvar) specifies the variable that identifies the alternatives for each case. The number of alternatives can vary with each case. alternatives() is required to estimate alternative-specific constants or if case-specific variables are specified in casevars().

casevars(varlist) specifies the case-specific variables that are constant for each case(). If there are a maximum of A alternatives, there will be A-1 sets of coefficients associated with casevars().

noconstant suppresses the A-1 alternative-specific constant terms.

random(varlist [, distribution]) specifies the alternative-specific variables that are to have random coefficients and optionally the assumed distribution of the random coefficients. The default distribution is normal, meaning Gaussian-distributed random coefficients. distribution may also be correlated, lnormal, tnormal, uniform, or triangle. random() may be specified more than once to specify different sets of variables that correspond to different coefficient distributions.

constraints(constraints), collinear; see [R] estimation options.

+---------+ ----+ Model 2 +----------------------------------------------------------

corrmetric(metric) specifies the estimation metric for correlated random coefficients. corrmetric(correlation), the default, estimates the standard deviations and correlations of the random coefficients. corrmetric(covariance) estimates variances and covariances, and corrmetric(cholesky) estimates Cholesky factors. corrmetric() is allowed only when random(varlist, correlated) is specified.

basealternative(#|lbl|str) specifies the alternative used to normalize the latent-variable location (also referred to as the level of utility). The base alternative may be specified as a number, label, or string. The default is the most frequent alternative. This option is ignored if neither alternative-specific constants nor case-specific variables are specified.

altwise specifies that alternativewise deletion be used when marking out observations due to missing values in your variables. The default is to use casewise deletion; that is, the entire group of observations making up a case is deleted if any missing values are encountered. This option does not apply to observations that are marked out by the if or in qualifier or the by prefix.

+-----------+ ----+ SE/Robust +--------------------------------------------------------

vce(vcetype) specifies the type of standard error reported, which includes types that are derived from asymptotic theory (oim, opg), that are robust to some kinds of misspecification (robust), that allow for intragroup correlation (cluster clustvar), and that use bootstrap or jackknife methods (bootstrap, jackknife); see [R] vce_option.

Specifying vce(robust) is equivalent to specifying vce(cluster caseid).

If specifying vce(bootstrap) or vce(jackknife), you must also specify basealternative().

+-----------+ ----+ Reporting +--------------------------------------------------------

level(#), nocnsreport; see [R] estimation options.

display_options: noci, nopvalues, noomitted, vsquish, noemptycells, baselevels, allbaselevels, nofvlabel, fvwrap(#), fvwrapon(style), cformat(%fmt), pformat(%fmt), sformat(%fmt), and nolstretch; see [R] estimation options.

+-------------+ ----+ Integration +------------------------------------------------------

intmethod(seqtype [, antithetics | mantithetics]) specifies the method of generating the point sets used in the Monte Carlo integration. intmethod(hammersley), the default, uses the Hammersley sequence; intmethod(halton) uses the Halton sequence; and intmethod(random) uses a sequence of uniform random numbers.

antithetics and mantithetics specify that a unidimensional antithetic sequence or a multidimensional antithetic sequence, respectively, be generated instead of the standard implementation of the requested seqtype. These methods improve the accuracy of the Monte Carlo integration at the cost of additional computation time; see Methods and formulas.

intpoints(#) specifies the number of raw points to use in the Monte Carlo integration. The default number of points is a function of model complexity and integration method. If intmethod(hammersley) or intmethod(halton) is used and there are r uncorrelated random coefficients in the model, the default is 50 x floor(sqrt{r}). If there are also correlated random coefficients in the model and c is the number of correlation parameters, another 50 x floor(sqrt{c}) points are added. If intmethod(random) is used, the number of points is the above times 5. Larger values of intpoints() provide better approximations of the log likelihood at the cost of additional computation time.

intburn(#) specifies where in the Hammersley or Halton sequence to start, which helps reduce the correlation between the sequences of each dimension. The default is to discard the first n initial elements from each sequence, where n is the largest prime used to generate the sequences. This option may not be specified with intmethod(random).

intseed(#) specifies the seed to use for generating uniform pseudorandom sequences. This option may be specified only with intmethod(random). # must be an integer between 0 and 2^{31}-1. The default is to use the current seed value from Stata's uniform random-number generator; see [R] set seed.

favor(speed|space) instructs asmixlogit to favor either speed or space when generating the integration points. favor(speed) is the default. When favoring speed, the integration points are generated once and stored in memory, thus increasing the speed of evaluating the likelihood. This speed increase can be seen when there are many cases or when the user specifies a large number of integration points in intpoints(#). When favoring space, the integration points are generated repeatedly with each likelihood evaluation.

+--------------+ ----+ Maximization +-----------------------------------------------------

maximize_options: difficult, technique(algorithm_spec), iterate(#), [no]log, trace, gradient, showstep, hessian, showtolerance, tolerance(#), ltolerance(#), nrtolerance(#), nonrtolerance, and from(init_specs); see [R] maximize. These options are seldom used.

Setting the optimization type to technique(bhhh) resets the default vcetype to vce(opg).

The following option is available with asmixlogit but is not shown in the dialog box:

coeflegend; see [R] estimation options.


Setup . webuse inschoice

Mixed logit model with a fixed coefficient for premium and random coefficients for deductible . asmixlogit choice premium, case(id) alternatives(insurance) random(deductible)

Mixed logit model with correlated random coefficients for premium and deductible . asmixlogit choice, case(id) alternatives(insurance) random(deductible premium, correlated)

Stored results

asmixlogit stores the following in e():

Scalars e(N) number of observations e(N_case) number of cases e(k) number of parameters e(k_alt) number of alternatives e(k_casevars) number of case-specific variables e(k_eq) number of equations in e(b) e(k_eq_model) number of equations in overall model test e(df_m) model degrees of freedom e(ll) log simulated-likelihood e(N_clust) number of clusters e(const) constant indicator e(intpoints) number of raw integration points e(lsequence) length of each integration sequence e(intburn) starting sequence index e(chi2) chi-squared e(p) model test p-value e(ll_c) log likelihood, comparison model e(chi2_c) chi-squared, comparison test e(df_c) degrees of freedom, comparison test e(p_c) p-value for comparison test e(alt_min) minimum number of alternatives e(alt_avg) average number of alternatives e(alt_max) maximum number of alternatives e(rank) rank of e(V) e(ic) number of iterations e(rc) return code e(converged) 1 if converged, 0 otherwise

Macros e(cmd) asmixlogit e(cmdline) command as typed e(depvar) name of dependent variable e(casevars) case-specific variables e(case) variable defining cases e(altvar) variable defining alternatives e(alteqs) alternative equation names e(alt#) alternative labels e(base) base alternative e(corrmetric) correlation metric for correlated random coefficients e(wtype) weight type e(wexp) weight expression e(title) title in estimation output e(clustvar) name of cluster variable e(chi2type) type of chi-squared e(vce) vcetype specified in vce() e(vcetype) title used to label Std. Err. e(opt) type of optimization e(which) max or min; whether optimizer is to perform maximization or minimization e(ml_method) type of ml method e(intmethod) technique used to generate sequences e(sequence) type of sequences e(mc_rngstate) random-number state used e(user) name of likelihood-evaluator program e(technique) maximization technique e(properties) b V e(predict) program used to implement predict e(asbalanced) factor variables fvset as asbalanced e(asobserved) factor variables fvset as asobserved

Matrices e(b) coefficient vector e(Cns) constraints matrix e(ilog) iteration log (up to 20 iterations) e(gradient) gradient vector e(V) variance-covariance matrix of the estimators e(V_modelbased) model-based variance

Functions e(sample) marks estimation sample

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index