help asclogit dialog: asclogit
also see: asclogit postestimation
-------------------------------------------------------------------------------
Title
[R] asclogit -- Alternative-specific conditional logit (McFadden's
choice) model
Syntax
asclogit depvar [indepvars] [if] [in] [weight], case(varname)
alternatives(varname) [options]
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 used as base category
noconstant suppress alternative-specific constant
terms
altwise use alternative-wise 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
Maximization
maximize_options control the maximization process; seldom
used
+ coeflegend display coefficients' legend instead of
coefficient table
-------------------------------------------------------------------------
* case(varname) and alternatives(varname) are required.
+ coeflegend does not appear in the dialog box.
bootstrap, by, jackknife, statsby, and xi 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 [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. asclogit requires
multiple observations for each case (individual or decision), where each
observation represents an alternative that may be chosen. The cases are
identified by the variable specified in the case() option, whereas the
alternatives are identified by the variable specified in the
alternatives() option. The outcome or chosen alternative is identified
by a value of 1 in depvar, whereas zeros indicate the alternatives that
were not chosen. There can be multiple alternatives chosen for each
case.
asclogit allows two types of independent variables: alternative-specific
variables and case-specific variables. Alternative-specific variables
vary across both cases and alternatives and are specified in indepvars.
Case-specific variables vary only across cases and are specified in the
casevars() option.
See [R] clogit for a more general application of conditional logistic
regression. For example, clogit would be used when you have grouped data
where each observation in a group may be a different individual, but all
individuals in a group have a common characteristic. You may use clogit
to obtain the same estimates as asclogit by specifying the case()
variable as the group() variable in clogit and generating variables that
interact the casevars() in asclogit with each alternative (in the form of
an indicator variable), excluding the interaction variable associated
with the base alternative. asclogit takes care of this data-management
burden for you. Also, for clogit, each record (row in your data) is an
observation, whereas in asclogit each case, consisting of several records
(the alternatives) in your data, is an observation. This last point is
important because asclogit will drop observations, by default, in a
casewise fashion. That is, if there is at least one missing value in any
of the variables for each record of a case, the entire case is dropped
from estimation. To use alternative-wise deletion, specify the altwise
option and only the records with missing values will be dropped from
estimation.
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 alternative-wise 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, that are
robust to some kinds of misspecification, that allow for intragroup
correlation, and that use bootstrap or jackknife methods; see [R]
vce_option.
+-----------+
----+ Reporting +--------------------------------------------------------
level(#); see [R] estimation options.
or reports the estimated coefficients transformed to odds ratios, i.e.,
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.
+--------------+
----+ Maximization +-----------------------------------------------------
maximize_options: difficult, technique(algorithm_spec), iterate(#),
[no]log, trace, gradient, showstep, hessian, showtolerance,
tolerance(#), ltolerance(#), nrtolerance(#), nonrtolerance,
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, casevars(sex income) case(id)
alternatives(car)
Replay results, displaying odds ratios and suppressing the header on the
coefficient table
. asclogit, or noheader
Saved results
asclogit saves 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 model Wald test
e(k_autoCns) number of base, empty, and omitted constraints
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(F) F statistic
e(p) significance
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) offset
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(singularHmethod) m-marquardt or hybrid; method used when Hessian
is singular
e(crittype) optimization criterion
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
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
Also see
Manual: [R] asclogit
Help: [R] asclogit postestimation;
[R] asmprobit, [R] asroprobit, [R] clogit, [R] logistic, [R]
logit, [R] nlogit, [R] ologit