Stata help for xt
help xt, help iis, help tis dialogs: iis tsset -------------------------------------------------------------------------------
Title
[XT] xt -- Introduction to xt commands
Syntax
xtcmd ... [, i(varname_i) t(varname_t) ...]
iis [varname_i] [, clear]
tis [varname_i] [, clear]
Description
The xt series of commands provide tools for analyzing cross-sectional time-series datasets:
xtdes Describe pattern of xt data xtsum Summarize xt data xttab Tabulate xt data xtdata Faster specification searches with xt data
xtline Line plots with xt data
xtreg Fixed-, between- and random-effects, and population-averaged linear models xtregar Fixed- and random-effects linear models with an AR(1) disturbance xtgls Panel-data models using GLS xtpcse OLS or Prais-Winsten models with panel-corrected standard errors xtrc Random coefficients models xtivreg Instrumental variables and two-stage least squares for panel-data models xtabond Arellano-Bond linear, dynamic panel data estimator
xttobit Random-effects tobit models xtintreg Random-effects interval data regression models
xtlogit Fixed-effects, random-effects, & population-averaged logit models xtprobit Random-effects and population-averaged probit models xtcloglog Random-effects and population-averaged cloglog models
xtpoisson Fixed-effects, random-effects, & population-averaged Poisson models xtnbreg Fixed-effects, random-effects, & population-averaged negative binomial models
xtgee Population-averaged panel-data models using GEE
Cross-sectional time-series (longitudinal) datasets are of the form x_it, where x_it is a vector of observations for unti i and time t. The particular commands (such as xtdes, xtsum, xtreg, etc.) are documented in their own help file entries. This entry deals with concepts common across commands.
iis is related to the i() option on the other xt commands. Command iis or option i() sets the name of the variable corresponding to the unit index i.
tis is similarly related to the t() option. Command tis or option t() sets the name of the variable corresponding to the time index t. tis without an argument displays the current name of the time variable.
Some xt commands use time-series operators in their internal calculations, and thus require that your data be tsset; see tsset. For instance, since xtabond uses time-series operators in its internal calculations, you must tsset your data before using it. The particular help file will indicate if tsset is required before using the for the command. For these commands, iis tis are neither sufficient nor recommended.
Note that specifying iis or tis will clear any previous tsset settings. Also, specifying tsset will override any settings specified by iss or tis.
Options
i(varname_i) specifies the variable name corresponding to index i in xit. This must be a single, numeric variable, although whether it takes on the values 1, 2, 3 or 1, 7, 9, or even -2, 2^1/2, pi, is irrelevant. (If the identifying variable is a string, use egen's group() function to make a numeric variable from it; see egen.)
For instance, if the cross-sectional time-series data are of persons in the years 1991-1994, each observation is a person in one of the years; there are four observations per person (assuming no missing data). varname_i is the name of the variable that uniquely identifies the persons.
You can specify the i() option the first time you estimate, or you can use the iis command to set the i() beforehand. Note that it is not necessary to specify i() if the data have been previously tsset or if iis has been previously specified -- in these cases, the group variable is taken from the previous setting.
t(varname_t) specifies the variable name corresponding to index t in xit. This must be a single, numeric variable, although whether it takes on the values 1, 2, 3 or 1, 7, 9, or even -2, 2^1/2, pi, is irrelevant.
For instance, if the cross-sectional time-series data are of persons in the years 1991-1994, each observation is a person in one of the years; there are four observations per person (assuming no missing data). varname_t is the name of the variable that uniquely identifies the persons.
You can specify the t() option the first time you estimate, or you can use the tis command to set the t() beforehand. Note that it is not necessary to specify t() if the data have been previously tsset or if tis has been previously specified -- in these cases, the group variable is taken from the previous setting.
clear removes the definition of i() or t(). For instance, typing tis, clear makes Stata forget the identity of the t() variable.
Remarks
Once i() and t() have been specified, either by option or by the iis and tis commands, they need not be specified again except to change the variable's identity.
iis and tis, without arguments, list the current name of the index variable.
Example
An xt dataset:
pid yr_visit fev age sex height smokes ---------------------------------------------- 1071 1991 1.21 25 1 69 0 1071 1992 1.52 26 1 69 0 1071 1993 1.32 28 1 68 0 1072 1991 1.33 18 1 71 1 1072 1992 1.18 20 1 71 1 1072 1993 1.19 21 1 71 0
The other xt commands need to know the identities of the variables identifying patient and time. You could type
. iis pid . tis yr_visit
Also see
Manual: [XT] xt
Online: xtabond, xtcloglog, xtdata, xtdes, xtfrontier, xtgee, xtgls, xthtaylor, xtintreg, xtivreg, xtlogit, xtnbreg, xtpcse, xtpoisson, xtprobit, xtrc, xtreg, xtregar, xtsum, xttab, xttobit; tsset