Stata 15 help for asclogit

[R] asclogit -- Alternative-specific conditional logit (McFadden's choice) model

Syntax

asclogit depvar [indepvars] [if] [in] [weight], case(varname) alternatives(varname) [options]

depvar equal to 1 identifies the outcome or chosen alternatives, whereas a 0 indicates the alternatives that were not chosen. There can be multiple alternatives chosen for each case.

options Description ------------------------------------------------------------------------- Model * case(varname) use varname to identify cases * alternatives(varname) use varname to identify the alternatives available for each case casevars(varlist) case-specific variables basealternative(#|lbl|str) alternative to normalize location noconstant suppress alternative-specific constant terms altwise use alternativewise deletion instead of casewise deletion offset(varname) include varname in model with coefficient constrained to 1 constraints(constraints) apply specified linear constraints collinear keep collinear variables

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

Reporting level(#) set confidence level; default is level(95) or report odds ratios noheader do not display the header on the coefficient table 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

Maximization maximize_options control the maximization process; seldom used

coeflegend display legend instead of statistics ------------------------------------------------------------------------- * case(varname) and alternatives(varname) are required. indepvars and varlist may contain factor variables; see fvvarlist. bootstrap, by, fp, jackknife, and statsby are allowed; see prefix. Weights are not allowed with the bootstrap prefix. fweights, iweights, and pweights are allowed (see weight), but they are interpreted to apply to cases as a whole, not to individual observations. See Use of weights in [R] clogit. coeflegend does not appear in the dialog box. See [R] asclogit postestimation for features available after estimation.

Menu

Statistics > Categorical outcomes > Alternative-specific conditional logit

Description

asclogit fits McFadden's choice model, which is a specific case of the more general conditional logistic regression model fit by clogit. The command requires multiple observations for each case (individual or decision), where each observation represents an alternative that may be chosen. asclogit allows two types of independent variables: alternative-specific variables, which vary across both cases and alternatives, and case-specific variables, which vary across only cases.

Options

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

case(varname) specifies the numeric variable that identifies each case. case() is required and must be integer valued.

alternatives(varname) specifies the variable that identifies the alternatives for each case. The number of alternatives can vary with each case; the maximum number of alternatives cannot exceed the limits of tabulate oneway; see [R] tabulate oneway. alternatives() is required and may be a numeric or a string variable.

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

basealternative(#|lbl|str) specifies the alternative that normalizes the latent-variable location (the level of utility). The base alternative may be specified as a number, label, or string depending on the storage type of the variable indicating alternatives. The default is the alternative with the highest frequency.

If vce(bootstrap) or vce(jackknife) is specified, you must specify the base alternative. This is to ensure that the same model is fit with each call to asclogit.

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

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.

offset(varname), constraints(numlist|matname), collinear; see [R] estimation options.

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

vce(vcetype) specifies the type of standard error reported, which includes types that are derived from asymptotic theory (oim), 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.

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

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

or reports the estimated coefficients transformed to odds ratios, that is, exp(b) rather than b. Standard errors and confidence intervals are similarly transformed. This option affects how results are displayed, not how they are estimated. or may be specified at estimation or when replaying previously estimated results.

noheader prevents the coefficient table header from being displayed.

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.

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

technique(bhhh) is not allowed.

The initial estimates must be specified as from(matname [, copy ]), where matname is the matrix containing the initial estimates and the copy option specifies that only the position of each element in matname is relevant. If copy is not specified, the column stripe of matname identifies the estimates.

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

coeflegend; see [R] estimation options.

Examples

Setup . webuse choice

Fit alternative-specific conditional logit model . asclogit choice dealer, case(id) alternatives(car) casevars(sex income)

Replay results, displaying odds ratios and suppressing the header on the coefficient table . asclogit, or noheader

Stored results

asclogit 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_indvars) number of alternative-specific variables 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 likelihood e(N_clust) number of clusters e(const) constant indicator e(i_base) base alternative index e(chi2) chi-squared e(p) p-value for model 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) asclogit e(cmdline) command as typed e(depvar) name of dependent variable e(indvars) alternative-specific independent 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(wtype) weight type e(wexp) weight expression e(title) title in estimation output e(clustvar) name of cluster variable e(offset) linear offset variable e(chi2type) Wald, type of model chi-squared test 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(user) name of likelihood-evaluator program e(technique) maximization technique e(datasignature) the checksum e(datasignaturevars) variables used in calculation of checksum e(properties) b V e(estat_cmd) program used to implement estat e(predict) program used to implement predict e(marginsnotok) predictions disallowed by margins e(asbalanced) factor variables fvset as asbalanced e(asobserved) factor variables fvset as asobserved

Matrices e(b) coefficient vector e(stats) alternative statistics e(altvals) alternative values e(altfreq) alternative frequencies e(alt_casevars) indicators for estimated case-specific coefficients -- e(k_alt) x e(k_casevars) 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