**[XT] xtologit** -- Random-effects ordered logistic models

__Syntax__

**xtologit** *depvar* [*indepvars*] [*if*] [*in*] [*weight*] [**,** *options*]

*options* Description
-------------------------------------------------------------------------
Model
__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
**lrmodel** perform the likelihood-ratio model test
instead of the default Wald test
__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

Integration
__intm__**ethod(***intmethod***)** integration method; *intmethod* may be
__mv__**aghermite** (the default) or __gh__**ermite**
__intp__**oints(***#***)** use # quadrature points; default is
**intpoints(12)**
Maximization
*maximize_options* control the maximization process; seldom
used

__startg__**rid(***numlist***)** improve starting value of the
random-intercept parameter by performing a
grid search
__nodis__**play** suppress display of header and coefficients
__coefl__**egend** display legend instead of statistics
-------------------------------------------------------------------------
A panel variable must be specified; see **xtset**.
*indepvars* may contain factor variables; see fvvarlist.
*depvar* and *indepvars* may contain time-series operators; see tsvarlist.
**by**, **fp**, and **statsby** are allowed; see prefix.
**fweight**s, **iweight**s, and **pweight**s are allowed; see weight.
**startgrid()**, **nodisplay**, and **coeflegend** do not appear in the dialog box.
See **[XT] xtologit postestimation** for features available after estimation.

__Menu__

**Statistics > Longitudinal/panel data > Ordinal outcomes >** **Logistic**
**regression (RE)**

__Description__

**xtologit** fits random-effects ordered logistic models. The actual values
taken on by the dependent variable are irrelevant, although larger values
are assumed to correspond to "higher" outcomes. The conditional
distribution of the dependent variable given the random effects is
assumed to be multinomial with success probability determined by the
logistic cumulative distribution function.

__Options__

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

**offset(***varname***)**, **constraints(***constraints***)**, **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 **[XT] ***vce_options*.

Specifying **vce(robust)** is equivalent to specifying **vce(cluster**
*panelvar***)**; see *xtologit and the robust VCE estimator* in *Methods and*
*formulas* of **[XT] xtologit**.

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

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

**or** reports the estimated coefficients transformed to odds ratios, that
is, e^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.

**lrmodel**, **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**.

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

**intmethod(***intmethod***)**, **intpoints(***#***)**; 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.

The following options are available with **xtologit** but are not shown in
the dialog box:

**startgrid(***numlist***)** performs a grid search to improve the starting value
of the random-intercept parameter. No grid search is performed by
default unless the starting value is found to not be feasible; in
this case, **xtologit** runs **startgrid(0.1 1 10)** and chooses the value
that works best. You may already be using a default form of
**startgrid()** without knowing it. If you see **xtologit** displaying Grid
node 1, Grid node 2, ... following Grid node 0 in the iteration log,
that is **xtologit** doing a default search because the original starting
value was not feasible.

**nodisplay** is for programmers. It suppresses the display of the header
and the coefficients.

**coeflegend**; see **[R] estimation options**.

__Technical note__

The random-effects logit model is calculated using quadrature, which is
an approximation whose accuracy depends partially on the number of
integration points used. We can use the **quadchk** command to see if
changing the number of integration points affects the results. If the
results change, the quadrature approximation is not accurate given the
number of integration points. Try increasing the number of integration
points using the **intpoints()** option and again run **quadchk**. Do not
attempt to interpret the results of estimates when the coefficients
reported by **quadchk** differ substantially. See **[XT] quadchk** for details
and **[XT] xtprobit** for an example.

Because the **xtologit** likelihood function is calculated by Gauss-Hermite
quadrature, on large problems, the computations can be slow. Computation
time is roughly proportional to the number of points used for the
quadrature.

__Example__

Setup
**. webuse tvsfpors**
**. xtset school**

Random-effects ordered logit regression
**. xtologit thk prethk cc##tv**

__Video example__

Ordered logistic and probit for panel data

__Stored results__

**xtologit** stores the following in **e()**:

Scalars
**e(N)** number of observations
**e(N_g)** number of groups
**e(k)** number of parameters
**e(k_aux)** number of auxiliary parameters
**e(k_eq)** number of equations in **e(b)**
**e(k_eq_model)** number of equations in overall model test
**e(k_dv)** number of dependent variables
**e(k_cat)** number of categories
**e(df_m)** model degrees of freedom
**e(ll)** log likelihood
**e(ll_0)** log likelihood, constant-only model
**e(ll_c)** log likelihood, comparison model
**e(chi2)** chi-squared
**e(chi2_c)** chi-squared for comparison test
**e(N_clust)** number of clusters
**e(sigma_u)** panel-level standard deviation
**e(n_quad)** number of quadrature points
**e(g_min)** smallest group size
**e(g_avg)** average group size
**e(g_max)** largest group size
**e(p)** p-value for model test
**e(rank)** rank of **e(V)**
**e(rank0)** rank of **e(V)** for constant-only model
**e(ic)** number of iterations
**e(rc)** return code
**e(converged)** **1** if converged, **0** otherwise

Macros
**e(cmd)** **meglm**
**e(cmd2)** **xtologit**
**e(cmdline)** command as typed
**e(depvar)** name of dependent variable
**e(covariates)** list of covariates
**e(ivar)** variable denoting groups
**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** or **LR**; type of model chi-squared test
**e(vce)** *vcetype* specified in **vce()**
**e(vcetype)** title used to label Std. Err.
**e(intmethod)** integration method
**e(distrib)** **Gaussian**; the distribution of the random effect
**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(properties)** **b V**
**e(predict)** program used to implement **predict**
**e(marginsok)** predictions allowed by **margins**
**e(marginswtype)** weight type for **margins**
**e(marginswexp)** weight expression for **margins**
**e(marginsdefault)** default **predict()** specification for **margins**
**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
**e(gradient)** gradient vector
**e(cat)** category values
**e(V)** variance-covariance matrix of the estimators
**e(V_modelbased)** model-based variance

Functions
**e(sample)** marks estimation sample