*! version 2.0 21dev2020
help xtsemipar (SJ13-2: st0296)

Title

xtsemipar -- Semiparametric estimator in panel data

Syntax

xtsemipar varlist [if] [in] [weight], nonpar(varname)
[options]

* nonpar(varname) specify the variable that enters the model nonlinearly

generate([string1] string2) store fitted values in string1 and residuals of the parametric estimation in string2

degree(#) specify the degree of the local weighted polynomial
fit used in the Epanechnikov kernel if spline is not specified (see
lpoly); if spline is specified, degree() specifies the power (or degree) of
the splines; default is degree(4) (see bspline)

knots1(numlist) specify a list of at least two ascending knots used for the spline interpolation allowing to remove fixed effects

nograph suppress graph

spline use B-splines to perform the nonparametric fit instead of kernel-weighted local polynomial smoothing, the default (see bspline)

knots2(numlist) specify a list of at least two ascending knots used for the last-step spline interpolation, which yields the graph

kernel(kernel) specify kernel function to be used in the local linear regression; default is kernel(epanechnikov) (see lpoly)

bwidth(#) specify kernel bandwidth

robust specify that the type of standard error reported is corrected using the Huber/White/sandwich estimator

cluster(varname) specify that the type of standard error reported is corrected using the clustered sandwich estimator

ci plot confidence bands

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

* nonpar() is required.

aweights and fweights are allowed; see weight.

Description

xtsemipar estimates Baltagi and Li's (2002) series
semiparametric fixed-effects regression estimator. The main options
allow the use of a classical nonparametric estimator based on a local polynomial fit or a spline
interpolation. This last technique yields similar results to the
polynomial interpolation but better approximates complex shapes and does
not suffer from Runge's phenomenon.

Options

nonpar(varname) specifies a
(continuous) variable that nonlinearly enters the model. nonpar()
is required.

generate(string1 [string2]) stores the
(centered) nonparametric fit evaluated at the values of the
nonpar() variable. string2 stores the (centered)
partialled-out residuals, that is, the part of the dependent variable
that is not explained by the parametric part of the estimation. These
residuals are used to estimate the local polynomial smooth or the
splines. This option is particularly handy if users want to perform additional tests or estimations based on the residuals of the semiparametric fit.

degree(#) (a nonnegative integer) specifies the degree of
the polynomial to be used in the polynomial smoothing or the power of
the series estimator in the spline smoothing. The default is
degree(4).

knots1(numlist) specifies a list
of at least two ascending knots on which the splines estimated to remove
fixed effects are based. This option is seldom used. If knots1()
is not specified, bspline will initialize the list to the minimum
and maximum of nonpar(). The number of knots will then be chosen
optimally.

nograph suppresses drawing the graph of the estimated
smooth.

spline specifies that the nonparametric fit be done by
using B-splines (see Newson [2000]). The default option is a
kernel-weighted local polynomial fit based on an Epanechnikov kernel.
Spline interpolation yields similar results to polynomial fit but is
more flexible and does not suffer from some weaknesses that affect
polynomial fit, such as Runge's phenomenon.

knots2(numlist) specifies a list of at
least two ascending knots on which the spline interpolation appearing in
the graph are based. This option is seldom used. If knots2() is
not specified, bspline will initialize the list to the minimum and
maximum of nonpar(). The number of knots will then be chosen
optimally.

kernel(kernel) defines the kernel used in the local linear regression underlying the graph of the relationship between the variables entering the model non-linearly and the dependent variable.
The default option is epanechnikov kernel (see lpoly).

bwidth(#) specifies the half-width of the kernel, the width
of the smoothing window around each point. If bwidth() is not
specified, a rule-of-thumb bandwidth estimator is calculated and used.

robust uses the Huber/White/sandwich variance estimator to
compute standard errors of the estimated parameters. All the inference
and confidence intervals will be corrected accordingly.

cluster(varname) computes
cluster-corrected standard errors of the estimated parameters and
adjusts the inference as well as confidence intervals.

ci plots confidence intervals around the polynomial
smoothing or the spline. The confidence level used is the one specified
in level().

level(#) specifies the confidence level, as a percentage,
for confidence intervals. The default is level(95) or as set by
set level.

Requirement

xtsemipar can only be used if data are declared to be panel
data through the xtset or tsset command. Before using
xtsemipar, you must install Newson's (2000) bspline program.

Examples

Setup

. webuse invest2

. generate logi=log(invest)

. generate logm=log(market)

. generate logs=log(stock)

. xtset company time

Fixed-effects semiparametric regression with default quartic local polynomial smooth for the nonparametric part

. xi: xtsemipar logi logm i.time, nonpar(logs)

Same as above but with quartic spline smoothing, confidence intervals, and standard errors clustered at company level

. xi: xtsemipar logi logm i.time, nonpar(logs) spline ci cluster(company)

Same as above but with smoothed values (a) and partialled-out residuals (b) as variables instead of graphing

. xi: xtsemipar logi logm i.time, nonpar(logs) generate(a b) nograph

Saved results

xtsemipar saves the following in e():

Scalars

e(N) number of observations

e(df_m) model degrees of freedom

e(df_r) residual degrees of freedom

e(ll) log likelihood

e(F) F statistic

e(r2) within R-squared

e(r2_a) adjusted R-squared

e(rmse) root mean squared error

e(mss) model sum of squares

e(rss) residual sum of squares

Macros

e(cmd) xtsemipar

e(depvar) name of dependent variable

e(title) title in estimation output

e(properties) b V

e(model) "Baltagi Fixed-effect Series Semiparametric Estimation"

Matrices

e(b) coefficient vector

e(V) variance-covariance matrix of the estimators

Functions

e(sample) marks estimation sample

References

Baltagi, B. H., and D. Li. 2002. Series estimation of partially
linear panel data models with fixed effects.
Annals of Economics and Finance 3: 103-116.

Newson, R. 2000. sg151: B-splines and splines parameterized by their
values at reference points on the x-axis.
Stata Technical Bulletin 57: 20-27. Reprinted in
Stata Technical Bulletin Reprints, vol. 10, pp. 221-230. College Station, TX: Stata Press.

Authors

François Libois

Professor at Paris School of Economics

Researcher INRAE

Paris, France

francois.libois@psemail.eu

Vincenzo Verardi

University of Namur

Centre for Research in the Economics of Development (CRED)

Namur, Belgium

vincenzo.verardi@fundp.ac.be

Warning

Users of Stata versions older than 16 should use older versions of bspline as well that can be installed
by typing, e.g. "net install sg151_2.pkg"

Remark

The “if” and “in” conditions in semipar work in the same way as when Stata’s difference operator is used.
xtsemipar y x1 x2 x3 if x2>=0 is the semiparametric equivalent to d.(y x*) if x2>=0. This is not necessarily the
same as restricting the sample before the estimations.

Also see

Article: Stata Journal, volume 13, number 2: st0296

Help: [R] lpoly, bspline (if installed)