lsplincom: Linear Combination of Estimators for 'lspartition' Package

Description Usage Arguments Value Methods (by generic) Author(s) References See Also Examples

View source: R/lsplincom.R

Description

lsplincom implements user-specified linear combinations across different data sub-groups for regression functions estimation, and computes corresponding (pointwise and uniform) robust bias-corrected inference measures. Estimation and inference is implemented using the lspartition package. See Cattaneo and Farrell (2013) and Cattaneo, Farrell and Feng (2019a) for complete details.

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

1
2
3
4
5
6
7
8
9
lsplincom(y, x, G, R, eval = NULL, neval = NULL, level = 95,
  band = FALSE, cb.method = NULL, cb.grid = NULL, cb.ngrid = 50,
  B = 1000, subset = NULL, knot = NULL, ...)

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

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

Arguments

y

Outcome variable.

x

Independent variable. A matrix or data frame.

G

Group indicator. It may take on multiple discrete values.

R

A numeric vector giving the linear combination of interest. Each element is the coefficient of the conditional mean estimator of one group, and they are ordered ascendingly along the value of G.

eval

Evaluation points. A matrix or data frame.

neval

Number of quantile-spaced evaluating points.

level

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

band

If TRUE, the critical value for constructing confidence band is calculated. Default is band=FALSE.

cb.method

Method used to calculate the critical value for confidence bands. Options are "pl" for a simulation-based plug-in procedure, and "wb" for a wild bootstrap procedure. If band=TRUE with cb.method unspecified, default is cb.method="pl".

cb.grid

A matrix containing all grid points used to construct confidence bands. Each row correponds to the coordinates of one grid point.

cb.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.

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.

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. See help for lsprobust.

...

Arguments to be passed to the function. See lsprobust.

object

class lsplincom 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).

sup.cval

Critical value for constructing confidence bands.

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., 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.

See Also

lsprobust, lspkselect, lsprobust.plot,

Examples

1
2
3
4
5
x   <- runif(500)
y   <- sin(4*x)+rnorm(500)
z   <- c(rep(0, 250), rep(1, 250))
est <- lsplincom(y, x, z, c(-1, 1))
summary(est)

lspartition documentation built on Aug. 9, 2019, 1:03 a.m.