lsprobust {lspartition}R Documentation

Partitioning-Based Least Squares Regression with Robust Inference.

Description

lsprobust implements partitioning-based least squares point estimators for the regression function and its derivatives. It also provides robust bias-corrected (pointwise and uniform) inference, including simulation-based confidence bands. Three series methods are supported: B-splines, compact supported wavelets, and piecewise polynomials. See Cattaneo and Farrell (2013) and Cattaneo, Farrell and Feng (2019a) for complete details.

Companion commands: lspkselect for data-driven IMSE-optimal selection of the number of knots on rectangular partitions; lsprobust.plot for plotting results; lsplincom for multiple sample estimation and inference.

A detailed introduction to this command is given in Cattaneo, Farrell and Feng (2019b).

For more details, and related Stata and R packages useful for empirical analysis, visit https://sites.google.com/site/nppackages/.

Usage

lsprobust(y, x, eval = NULL, neval = NULL, method = "bs", m = NULL,
  m.bc = NULL, deriv = NULL, smooth = NULL, bsmooth = NULL,
  ktype = "uni", knot = NULL, nknot = NULL, same = TRUE,
  bknot = NULL, bnknot = NULL, J = NULL, bc = "bc3", proj = TRUE,
  kselect = "imse-dpi", vce = "hc2", level = 95, uni.method = NULL,
  uni.grid = NULL, uni.ngrid = 50, uni.out = FALSE, band = FALSE,
  B = 1000, subset = NULL, rotnorm = TRUE)

## S3 method for class 'lsprobust'
print(x, ...)

## S3 method for class 'lsprobust'
summary(object, ...)

Arguments

y

Outcome variable.

x

Independent variable. A matrix or data frame.

eval

Evaluation points. A matrix or data frame.

neval

Number of quantile-spaced evaluating points.

method

Type of basis used for expansion. Options are "bs" for B-splines, "wav" for compactly supported wavelets (Cohen, Daubechies and Vial, 1993), and "pp" for piecewise polynomials. Default is method="bs".

m

Order of basis used in the main regression. Default is m=2. For B-splines, if smooth is specified but m is unspecified, default is m=smooth+2.

m.bc

Order of basis used to estimate leading bias. Default is m.bc=m+1. For B-splines, if bsmooth is specified but m.bc is unspecified, default is m.bc=bsmooth+2.

deriv

Derivative order of the regression function to be estimated. A vector object of the same length as ncol(x). Default is deriv=c(0,...,0).

smooth

Smoothness of B-splines for point estimation. When smooth=s, B-splines have s-order continuous derivatives. Default is smooth=m-2.

bsmooth

Smoothness of B-splines for bias correction. Default is bsmooth=m.bc-2.

ktype

Knot placement. Options are "uni" for evenly-spaced knots over the support of x and "qua" for quantile-spaced knots. Default is ktype="uni".

knot

A list of numeric vectors giving the knot positions (including boundary knots) for each dimension which are used in the main regression. The length of the list is equal to ncol(x). If not specified, it uses the number of knots either specified by users or computed by the companion command lspkselect to generate the corresponding knots according to the rule specified by ktype.

nknot

A numeric vector of the same length as ncol(x). Each element corresponds to the number of inner partitioning knots for each dimension used in the main regression. If not specified, nknot is computed by the companion command lspkselect.

same

If TRUE, the same knots are used for bias correction as that for the main regression. Default is same=TRUE.

bknot

A list of numeric vectors giving knot positions used for bias correction. If not specified and same=FALSE, it uses the number of knots either specified by users or computed by the companion command lspkselect to generate knots according to the rule specified by ktype.

bnknot

A numeric vector of the same length as ncol(x). Each element corresponds to the number of inner partitioning knots for each dimension used for bias correction. If not specified, bnknot is computed by the companion command lspkselect.

J

A numeric vector containing resolution levels of father wavelets for each dimension.

bc

Bias correction method. Options are "bc1" for higher-order-basis bias correction, "bc2" for least squares bias correction, and "bc3" for plug-in bias correction. Default are "bc3" for splines and piecewise polynomials and "bc2" for wavelets.

proj

If TRUE, projection of leading approximation error onto the lower-order approximation space is included for bias correction (splines and piecewise polynomials only). Default is proj=TRUE.

kselect

Method for selecting the number of inner knots used by lspkselect. Options are "imse-rot" for ROT implementation of IMSE-optimal number of knots and "imse-dpi" for second generation of DPI implementation of IMSE-optimal number of knots. Default is kselect="imse-dpi".

vce

Procedure to compute the heteroskedasticity-consistent (HCk) variance-covariance matrix estimator with plug-in residuals. Options are

  • "hc0" for unweighted residuals (HC0).

  • "hc1" for HC1 weights.

  • "hc2" for HC2 weights. Default.

  • "hc3" for HC3 weights.

level

Confidence level used for confidence intervals; default is level=95.

uni.method

Method used to implement uniform inference. Options are "pl" for a simulation-based plug-in procedure, "wb" for a wild bootstrap procedure. If unspecified, neither procedure is implemented. Default is uni.method=NULL.

uni.grid

A matrix containing all grid points used to implement uniform inference. Each row correponds to the coordinates of one grid point.

uni.ngrid

A numeric vector of the same length as ncol(x). Each element corresponds to the number of grid points for each dimension used to implement uniform inference. Default is uni.ngrid=50.

uni.out

If TRUE, the quantities used to implement uniform inference is outputted. Default is uni.out=FALSE.

band

If TRUE, the critical value for constructing confidence band is calculated. Default is band=FALSE. If band=TRUE with uni.method unspecified, default is uni.method="pl".

B

Number of simulated samples used to obtain the critical value for confidence bands. Default is B=1000.

subset

Optional rule specifying a subset of observations to be used.

rotnorm

If TRUE, ROT selection is adjusted using normal densities.

...

further arguments

object

class lsprobust objects.

Value

Estimate

A matrix containing eval (grid points), N (effective sample sizes), tau.cl (point estimates with a basis of order m), tau.bc (bias corrected point estimates with a basis of order m.bc), se.cl (standard error corresponding to tau.cl), and se.rb (robust standard error).

k.num

A matrix containing the number of inner partitioning knots used in the main regression and bias correction for each covariate.

knot

A list of knots for point estimation.

bknot

A list of knots for bias correction.

sup.cval

Critical value for constructing confidence band.

uni.output

A list containing quantities used to implement uniform inference.

opt

A list containing options passed to the function.

Methods (by generic)

Author(s)

Matias D. Cattaneo, Princeton University, Princeton, NJ. cattaneo@princeton.edu.

Max H. Farrell, University of Chicago, Chicago, IL. max.farrell@chicagobooth.edu.

Yingjie Feng (maintainer), Princeton University, Princeton, NJ. yingjief@princeton.edu.

References

Cattaneo, M. D., and M. H. Farrell (2013): Optimal convergence rates, Bahadur representation, and asymptotic normality of partitioning estimators. Journal of Econometrics 174(2): 127-143.

Cattaneo, M. D., M. H. Farrell, and Y. Feng (2019a): Large Sample Properties of Partitioning-Based Series Estimators. Annals of Statistics, forthcoming. arXiv:1804.04916.

Cattaneo, M. D., M. H. Farrell, and Y. Feng (2019b): lspartition: Partitioning-Based Least Squares Regression. R Journal, forthcoming. arXiv:1906.00202.

Cohen, A., I. Daubechies, and P.Vial (1993): Wavelets on the Interval and Fast Wavelet Transforms. Applied and Computational Harmonic Analysis 1(1): 54-81.

See Also

lspkselect, lsprobust.plot, lsplincom

Examples

x   <- data.frame(runif(500), runif(500))
y   <- sin(4*x[,1])+cos(x[,2])+rnorm(500)
est <- lsprobust(y, x)
summary(est)


[Package lspartition version 0.4 Index]