help npseries (http://staff.vwi.unibe.ch/kaiser/research.html)

Title

npseries -- Nonparametric Power Series Estimation

Syntax

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

series estimation options
maxorder(integer) maximal order of power series expansion

order(integer) user-specified order

linear(varlist) covariates entering linearly

logit series logit estimator

marginal effects
derivative(varlist) varlist for derivative estimation

at(varname=exp [...]) values for evaluation of marginal effects

subpop(exp) marginal effect in subpopulation

fixedreg assume fixed regressors in inference

VCE options
vce(vcetype) variance-covariance estimator

other options
listonly generating variable lists only

generate generate higher-order variables

collkeep keep collinear variables

detail show details of variable generating process

pweights and aweights are allowed; see weight.

Description

npseries provides useful features for nonparametric series estimation using
power series expansions.
First, one can automatically generate power series expansions of
a specified list of independent variables, retaining only non-redundant
higher-order terms.
Second, the command estimates nonparametric models using power series
expansions, where
the order of the series is either pre-specified by the user or determined
automatically by the minimization of a cross-validation criterion.
The cross-validation
criterion minimizes the integrated mean-squared error (see Hanson, 2014, Ch. 12).

Prediction and Marginal Effects

After estimating a model with npseries, predictions of the dependent
variable are obtained as usual by the predict postestimation command.
For example, in treatment evaluation, the series logit estimator
can be used to estimate the
propensity score, see Hirano et al. (2003).
The model is estimated by npseries using the
logit option and the
propensity score is then predicted using predict.

npseries can also compute point estimates and standard errors of
average marginal effects (AME). Marginal effects can be evaluated
at specific values of (some of) the independent variables and/or they can
be computed for a specific subpopulation. For example, in treatment evaluation,
the average treatment effect on the treated can be estimated by typing

npseries depvar treatvar indepvars,
derivative(treatvar) subpop(treatvar==1)

Options

maxorder(integer) specifies the highest order p
of the series expansion that is considered for the minimization
of the cross-validation criterion. Default is p=2.

order(integer) sets a user-specified order of the power
series.

linear(varlist) specifies covariates that enter the
model linearly. This allows for the estimation of semiparametric models.

logit specifies that the series logit estimator is used.
Default is the series linear estimator.

derivative(varlist) specifies the list of covariates
for which average derivatives (marginal effects) are to be computed.

at(varname1=exp [...]) can be used to evaluate marginal
effects at some specific values of (some of) the independent variables.
Example: at(exp=20 educ=10 female=1).

subpop(exp) specifies that marginal effects are
computed in a particular subpopulation defined by exp. Note that
exp must be specified as an if-statement. For example:
subpop(female==1).

fixedreg imposes the assumption of 'fixed regressors'
in the estimation of the standard errors for marginal effects.
This means that inference is performed conditional on the covariates
in the sample. The default is the unconditional variance.

vce(vcetype) specifies the estimator of the
variance-covariance matrix of the parameters. Default is vce(robust).

listonly Only variable lists of power series are
produced. No model is estimated.

generate Newly created higher-order terms are
added as variables to the dataset.

collkeep Perfectly collinear variables are
retained.

detail Provides more details in the production
of variable lists.

Example

/*load and edit sample data*/

. webuse nlsw88, clear

. g lnwage=ln(wage)

. rename ttl_exp exp

. rename married mar

/*estimate model of order 2 and compute derivatives*/

. npseries lnwage exp grade mar union, order(2) der(exp grade mar union)

/*estimate partially linear model and choose order of power series
automatically by minimizing the cross-validation criterion*/

. npseries lnwage exp grade, maxorder(5) der(exp) lin(mar union)

/*produce lists only*/

. npseries lnwage exp grade mar union, order(3) listonly gen

. ret list

Saved results

npseries saves the following in r() (depending on options):

Matrices

r(Der) derivatives (estimates, st.err., p-values)

r(CV) cross-validation criteria

Macros

r(xlist) list of all regressors

r(popt) order of (optimal) power series

r(expand_2) list of additional regressors in order 2

... ...

r(expand_p) list of additional regressors in order p

References

Hanson, Bruce E. 2014. Econometrics. University of Wisconsin.
http://www.ssc.wisc.edu/~bhansen/econometrics/Econometrics.pdf.

Hirano, Keisuke, Guido W. Imbens, and Geert Ridder.
"Efficient estimation of average treatment effects using the estimated propensity score."
Econometrica 71.4 (2003): 1161-1189.

Please cite npseries as follows

Kaiser, Boris (2014). "NPSERIES: Stata module to perform Nonparametric Power Series Estimation",
http://ideas.repec.org/c/boc/bocode/s457830.html.

Disclaimer

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

IN NO EVENT WILL THE COPYRIGHT HOLDERS OR THEIR EMPLOYERS, OR ANY OTHER PARTY WHO
MAY MODIFY AND/OR REDISTRIBUTE THIS SOFTWARE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM.

Author

For questions, queries or suggestions, please contact

Boris Kaiser, bo.kaiser@gmx.ch