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

__Syntax__

**asclogit** *depvar* [*indepvars*] [*if*] [*in*] [*weight*]**,** **case(***varname***)**
__alt__**ernatives(***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
* __alt__**ernatives(***varname***)** use *varname* to identify the alternatives
available for each case
__casev__**ars(***varlist***)** case-specific variables
__base__**alternative(***#*|*lbl*|*str***)** alternative to normalize location
__nocons__**tant** suppress alternative-specific constant
terms
**altwise** use alternativewise deletion instead of
casewise deletion
__off__**set(***varname***)** include *varname* in model with coefficient
constrained to 1
__const__**raints(***constraints***)** apply specified linear constraints
__col__**linear** keep collinear variables

SE/Robust
**vce(***vcetype***)** *vcetype* may be **oim**, __r__**obust**, __cl__**uster**
*clustvar*, __boot__**strap**, or __jack__**knife**

Reporting
__l__**evel(***#***)** set confidence level; default is **level(95)**
**or** report odds ratios
__nohead__**er** do not display the header on the
coefficient table
__nocnsr__**eport** 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

__coefl__**egend** 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.
**fweight**s, **iweight**s, and **pweight**s 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**, __nopv__**alues**, __noomit__**ted**, **vsquish**, __noempty__**cells**,
__base__**levels**, __allbase__**levels**, __nofvlab__**el**, **fvwrap(***#***)**, **fvwrapon(***style***)**,
**cformat(***%fmt***)**, **pformat(%***fmt***)**, **sformat(%***fmt***)**, and **nolstretch**; see **[R]**
**estimation options**.

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

*maximize_options*: __dif__**ficult**, __tech__**nique(***algorithm_spec***)**, __iter__**ate(***#***)**,
[__no__]__lo__**g**, __tr__**ace**, __grad__**ient**, **showstep**, __hess__**ian**, __showtol__**erance**,
__tol__**erance(***#***)**, __ltol__**erance(***#***)**, __nrtol__**erance(***#***)**, __nonrtol__**erance**, 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