**[XT] xtstreg** -- Random-effects parametric survival models

__Syntax__

**xtstreg** [*indepvars*] [*if*] [*in*] [*weight*]**,** __dist__**ribution(***distname***)**
[*options*]

*options* Description
-------------------------------------------------------------------------
Model
__nocons__**tant** suppress constant term
* __dist__**ribution(***distname***)** specify survival distribution
**time** use accelerated failure-time metric
__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)**
**nohr** do not report hazard ratios
__nosh__**ow** do not show st setting information
**lrmodel** perform the likelihood-ratio model test
instead of the default Wald test
__nocnsr__**eport** do not display constraints
__tr__**atio** report time ratios
*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 the header and coefficients
__coefl__**egend** display legend instead of statistics
-------------------------------------------------------------------------
* **distribution(***distname***)** is required.

*distname* Description
-------------------------------------------------------------------------
__e__**xponential** exponential survival distribution
__logl__**ogistic** loglogistic survival distribution
__ll__**ogistic** synonym for **loglogistic**
__w__**eibull** Weibull survival distribution
__logn__**ormal** lognormal survival distribution
__ln__**ormal** synonym for **lognormal**
__gam__**ma** gamma survival distribution
-------------------------------------------------------------------------

You must **stset** your data before using **xtstreg**; see **[ST] stset**.
A panel variable must be specified; see **xtset**.
*indepvars* may contain factor variables; see fvvarlist.
*varlist* 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. Weights must
be constant within panel.
**startgrid()**, **nodisplay**, and **coeflegend** do not appear in the dialog box.
See **[XT] xtstreg postestimation** for features available after estimation.

__Menu__

**Statistics > Longitudinal/panel data > Survival models >** **Parametric**
**survival models (RE)**

__Description__

**xtstreg** fits random-effects parametric survival-time models. The
conditional distribution of the response given the random effects is
assumed to be an exponential, a Weibull, a lognormal, a loglogistic, or a
gamma distribution. **xtstreg** can be used with single- or multiple-record
st data.

__Options__

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

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

**distribution(***distname***)** specifies the survival model to be fit. *distname*
is one of the following: **exponential**, **loglogistic**, **llogistic**,
**weibull**, **lognormal**, **lnormal**, or **gamma**. This option is required.

**time** specifies that the model be fit in the accelerated failure-time
metric rather than in the log relative-hazard metric. This option is
valid only for the exponential and Weibull models because these are
the only models that have both a proportional-hazards and an
accelerated failure-time parameterization. Regardless of metric, the
likelihood function is the same, and models are equally appropriate
in either metric; it is just a matter of changing interpretation.

**time** must be specified at estimation.

**offset(***varname***)** specifies that *varname* be included in the fixed-effects
portion of the model with the coefficient constrained to be 1.

**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**), and that allow
for intragroup correlation (**cluster** *clustvar*); see **[R] ***vce_option*.
If **vce(robust)** is specified, robust variances are clustered at the
highest level in the multilevel model.

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

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

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

**nohr**, which may be specified at estimation or upon redisplaying results,
specifies that coefficients rather than exponentiated coefficients be
displayed, that is, that coefficients rather than hazard ratios be
displayed. This option affects only how coefficients are displayed,
not how they are estimated.

This option is valid only for the exponential and Weibull models
because they have a natural proportional-hazards parameterization.
These two models, by default, report hazards ratios (exponentiated
coefficients).

**noshow** prevents **xtstreg** from showing the key st variables. This option
is rarely used because most users type **stset, show** or **stset, noshow**
to set once and for all whether they want to see these variables
mentioned at the top of the output of every st command; see **[ST]**
**stset**.

**lrmodel**, **nocnsreport**; see **[R] estimation options**.

**tratio** specifies that exponentiated coefficients, which are interpreted
as time ratios, be displayed. **tratio** is appropriate only for the
loglogistic, lognormal, and gamma models or for the exponential and
Weibull models when fit in the accelerated failure-time metric.

**tratio** may be specified at estimation or upon replay.

*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 **xtstreg** 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 be not feasible, in
which case **xtstreg** 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 **xtstreg** displaying Grid
node 1, Grid node 2, ... following Grid node 0 in the iteration log,
that is **xtstreg** 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**.

__Examples__

Setup
**. webuse catheter**
**. xtset patient**

Random-effects Weibull survival model
**. xtstreg age female, distribution(weibull)**

Replay results, but display coefficients rather than hazard ratios
**. xtstreg, nohr**

__Stored results__

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

Scalars
**e(N)** number of observations
**e(N_g)** number of groups
**e(k)** number of 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(df_m)** model degrees of freedom
**e(ll)** log likelihood
**e(N_clust)** number of clusters
**e(chi2)** chi-squared
**e(p)** p-value for model test
**e(ll_c)** log likelihood, comparison model
**e(chi2_c)** chi-squared, comparison model
**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(rank)** rank of **e(V)**
**e(ic)** number of iterations
**e(rc)** return code
**e(converged)** **1** if converged, **0** otherwise

Macros
**e(cmd)** **gsem**
**e(cmd2)** **xtstreg**
**e(cmdline)** command as typed
**e(depvar)** **_t**
**e(wtype)** weight type
**e(wexp)** weight expression (first-level weights)
**e(covariates)** list of covariates
**e(ivar)** variable denoting groups
**e(model)** model name
**e(title)** title in estimation output
**e(distribution)** distribution
**e(clustvar)** name of cluster variable
**e(offset)** offset
**e(intmethod)** integration method
**e(chi2type)** **Wald**; type of model chi-squared
**e(vce)** *vcetype* specified in **vce()**
**e(vcetype)** title used to label Std. Err.
**e(frm2)** **hazard** or **time**
**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(marginsnotok)** predictions disallowed by **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 (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