Description Usage Arguments Value Author(s) References See Also Examples
binsregtest
implements binscatterbased hypothesis testing procedures for parametric functional
forms of and nonparametric shape restrictions on the regression function estimators, following the results
in Cattaneo, Crump, Farrell and Feng (2019a).
If the binning scheme is not set by the user,
the companion function binsregselect
is used to implement binscatter in a
datadriven (optimal) way and inference procedures are based on robust bias correction.
Binned scatter plots can be constructed using the companion function binsreg
.
1 2 3 4 5 6 7 8  binsregtest(y, x, w = NULL, deriv = 0, testmodel = c(3, 3),
testmodelparfit = NULL, testmodelpoly = NULL, testshape = c(3, 3),
testshapel = NULL, testshaper = NULL, testshape2 = NULL,
bins = c(0, 0), nbins = NULL, binspos = "qs", binsmethod = "dpi",
nbinsrot = NULL, nsims = 500, simsgrid = 20, simsseed = 666,
vce = "HC1", cluster = NULL, dfcheck = c(20, 30),
masspoints = "on", weights = NULL, subset = NULL, numdist = NULL,
numclust = NULL)

y 
outcome variable. A vector. 
x 
independent variable of interest. A vector. 
w 
control variables. A matrix or a vector. 
deriv 
derivative order of the regression function for estimation, testing and plotting.
The default is 
testmodel 
a vector. 
testmodelparfit 
a data frame or matrix which contains the evaluation grid and fitted values of the model(s) to be tested against. The column contains a series of evaluation points at which the binscatter model and the parametric model of interest are compared with each other. Each parametric model is represented by other columns, which must contain the fitted values at the corresponding evaluation points. 
testmodelpoly 
degree of a global polynomial model to be tested against. 
testshape 
a vector. 
testshapel 
a vector of null boundary values for hypothesis testing. Each number 
testshaper 
a vector of null boundary values for hypothesis testing. Each number 
testshape2 
a vector of null boundary values for hypothesis testing. Each number 
bins 
Degree and smoothness for bin selection. 
nbins 
number of bins for partitioning/binning of 
binspos 
position of binning knots. The default is 
binsmethod 
method for datadriven selection of the number of bins. The default is 
nbinsrot 
initial number of bins value used to construct the DPI number of bins selector. If not specified, the datadriven ROT selector is used instead. 
nsims 
number of random draws for constructing confidence bands and hypothesis testing. The default is

simsgrid 
number of evaluation points of an evenlyspaced grid within each bin used for evaluation of
the supremum (or infimum) operation needed to construct confidence bands and hypothesis testing
procedures. The default is 
simsseed 
seed for simulation. 
vce 
Procedure to compute the variancecovariance matrix estimator. Options are

cluster 
cluster ID. Used for compute clusterrobust standard errors. 
dfcheck 
adjustments for minimum effective sample size checks, which take into account number of unique
values of 
masspoints 
how mass points in

weights 
an optional vector of weights to be used in the fitting process. Should be 
subset 
Optional rule specifying a subset of observations to be used. 
numdist 
Number of distinct for selection. Used to speed up computation. 
numclust 
Number of clusters for selection. Used to speed up computation. 

Results for 

Results for 

Results for 

Results for 

Results for 

A list containing options passed to the function, as well as total sample size 
Matias D. Cattaneo, University of Michigan, Ann Arbor, MI. cattaneo@umich.edu.
Richard K. Crump, Federal Reserve Bank of New York, New York, NY. richard.crump@ny.frb.org.
Max H. Farrell, University of Chicago, Chicago, IL. max.farrell@chicagobooth.edu.
Yingjie Feng (maintainer), University of Michigan, Ann Arbor, MI. yjfeng@umich.edu.
Cattaneo, M. D., R. K. Crump, M. H. Farrell, and Y. Feng. 2019a: On Binscatter. Working Paper.
Cattaneo, M. D., R. K. Crump, M. H. Farrell, and Y. Feng. 2019b: Binscatter Regressions. Working Paper.
1 2 3  x < runif(500); y < sin(x)+rnorm(500)
est < binsregtest(y,x, testmodelpoly=1)
summary(est)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.