*! version 1.0.0 20jul2013
help tihtest

Title

tihtest -- Testing for time invariant unobserved heterogeneity in GLMs for panel data

Syntax

tihtest depvar [indepvars] [if] [in] [weight]
[, options]

options

Model
model(cnormal) Gaussian fixed-effects linear model, the default

model(clogit) Fixed-effects logit model

model(cologit) Fixed-effects ordered logit model

model(cpoisson) Fixed-effects Poisson model

Starting values
from(init_specs) specify initial values for the coefficients

nosearch no attempt is made to improve on the initial values

restart select the random method to improve initial values

repeat(#) number of times # the random values are tried; the default is 10

rescale determine the rescaling of initial values

SE/Robust
vce(vcetype) vcetype may be oim or robust

robust synonym for vce(robust)

Reporting
displayestimates show full and pairwise estimates

level(#) set confidence interval level; default is level(95)

postscore save observation-by-observation scores in the estimation results list

posthessian save the Hessian corresponding to the full set of coefficients in the estimation results list

display_options control
spacing and display of omitted variables and base and empty cells

Maximization
maximize_options control the maximization process; seldom used

Panel and time variables must be specified. Use xtset.

indepvars may contain factor variables; see fvvarlist.

depvars and indepvars cannot contain time-series operators; see
tsvarlist.

by is allowed; see prefix.

aweights, fweights and pweights are allowed; see weight.

Weights must be constant within panel.

Description

tihtest performs the Bartolucci et al. (2015)
test for time invariant unobserved heterogeneity in Generalized Linear Models (GLMs) for panel data. To this aim,
this version fits full and pairwise Conditional Maximum Likelihood (CML) estimators for the logit, ordered logit,
Poisson and Gaussian linear models.

Options

Models

model(model) specifies the model to be estimated as: Gaussian fixed-effects linear model (cnormal), fixed-effects logit model (clogit), fixed-effects ordered logit model (cologit),
fixed-effects Poisson model (cpoisson). The default is cnormal.

Starting values

from(init_spec [, from_options]) specifies initial values for the coefficients.
You can specify the initial values in one of three ways: by specifying the name of a
vector containing the initial values (e.g., from(b0), where b0 is a
properly labeled vector); by specifying coefficient names with the values
(e.g., from(age=2.1 /sigma=7.4)); or by specifying a list of values
(e.g., from(2.1 7.4, copy)). Poor values in from() may lead to convergence
problems.

from_options description

skip specifies that any parameters found in the specified initialization
vector that are not also found in the model be ignored.
The default action is to issue an error message.

copy specifies that the list of values or the initialization
vector be copied into the initial-value vector by position rather than
by name.

nosearch determines that no attempts are made to improve on the initial
values via a search technique. In this case, the initial values become the
starting values.

restart determines that the random method of improving initial values is
to be attempted. See also mf_moptimize

repeat(#) controls how many times random values are tried if the random method is turned
on. The default is 10.

rescale determines whether rescaling is attempted. Rescaling is a deterministic method.
It also usually improves initial values, and usually reduces the number of subsequent iterations
required by the optimization technique.

SE

This entry describes the arguments of vce() option. vce() specifies how to estimate the
variance-covariance matrix (VCE) corresponding to the parameter estimates.
The standard errors reported in the table of parameter estimates are the
square root of the variances (diagonal elements) of the VCE.

vcetype description

oim observed information matrix (OIM). see vcetype. Even if oim is specified and the OIM VCE is displayed
(and reported), the tih test will be performed using the clustered sandwich estimator where clustvar is panelvar.

robust clustered sandwich estimator where clustvar is panelvar, where panelvar has been specified through xtset. In this case the resulting (co)variance matrix will also contain the covariance between the full and pairwise estimators.

Reporting

displayestimates allows the user to display estimation results.

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

postscore save observation-by-observation scores in the estimation results list.
All evaluators are of type gf2, thus scores are defined as the derivative of the objective function
with respect to the coefficients.

posthessian save the Hessian corresponding to the full set of coefficients
in the estimation results list. The Hessian is defined as the second derivative of
the objective function with respect to the coefficients.

Maximization

maximize_options: difficult, technique(algorithm_spec),
iterate(#), [no]log, tolerance(#),
ltolerance(#), nrtolerance(#),
nonrtolerance; see [R] maximize. These
options are seldom used.

Display

display_options:
vsquish,
baselevels,
allbaselevels;
see [R] estimation options.

Remarks

This version of tihtest does not handle unbalanced panel data.

References

If you find tihtest useful, please cite:

Bartolucci, F., Belotti, F., Peracchi, F., (2015). Testing for time-invariant unobserved heterogeneity in
generalized linear models for panel data. Journal of Econometrics, 184, 111-123.

Examples

Setup

. use health

. xtset id t

Fixed-effects logit model

. tihtest hinsurance age bmi hexp i.t, display model(clogit) robust

Fixed-effects ordered logit model

. tihtest hs age c.age#c.age bmi hexp i.t, display model(cologit) robust

Fixed-effects Poisson model

. tihtest visits age bmi hexp i.t, display model(cpoisson) robust

Fixed-effects Gaussian linear model

. tihtest income age bmi hexp i.t, display model(cnormal) robust

Saved results

tihtest saves the following in e() when the option displayestimates has been specified:

Scalars

e(N) number of observations

e(N_g) number of groups

e(g_min) minimum number of observations per group

e(g_avg) average number of observations per group

e(g_max) maximum number of observations per group

e(k_autoCns) number of base, empty, and omitted constraints

Macros

e(cmd) tihtest

e(cmdline) command as typed

e(depvar) name of dependent variable

e(ivar) variable denoting groups

e(tvar) variable denoting time

e(model) model type

e(wtype) weight type

e(wexp) weight expression

e(title) title in estimation output

e(vce) vcetype specified in vce()

e(vcetype) title used to label Std. Err.

e(properties) b V

Matrices

e(b) coefficient vector

e(V) variance-covariance matrix of the estimators

Functions

e(sample) marks estimation sample

tihtest saves the following in r():

Scalars

r(N) number of observations

r(N_g) number of groups

r(df) degrees of freedom

r(stat) chi-squared

r(p) p-value for the chi-squared

r(g_min) minimum number of observations per group

r(g_avg) average number of observations per group

r(g_max) maximum number of observations per group

r(k_autoCns) number of base, empty, and omitted constraints

Macros

r(cmd) tihtest

r(cmdline) command as typed

r(depvar) name of dependent variable

r(ivar) variable denoting groups

r(tvar) variable denoting time

r(model) model type

r(covariates) model covariates

Authors

Federico Belotti

Department of Economics and Finance, University of Rome Tor Vergata

Rome, Italy

federico.belotti at uniroma2.it

Also see

Help: xtreg; xtivreg; xtlogit; xtpoisson.