Description Usage Arguments Value Author(s) References See Also Examples
binsregselect
implements datadriven procedures for selecting the number of bins for binscatter
estimation. The selected number is optimal in minimizing integrated mean squared error (IMSE).
1 2 3 4 5 6  binsregselect(y, x, w = NULL, deriv = 0, bins = c(0, 0),
binspos = "qs", binsmethod = "dpi", nbinsrot = NULL,
simsgrid = 20, savegrid = F, vce = "HC1", useeffn = NULL,
cluster = NULL, dfcheck = c(20, 30), masspoints = "on",
weights = NULL, subset = NULL, norotnorm = F, 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 
bins 
a vector. 
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. 
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 
savegrid 
If true, a data frame produced containing grid. 
vce 
procedure to compute the variancecovariance matrix estimator. Options are

useeffn 
effective sample size to be used when computing the (IMSEoptimal) number of bins. This option is useful for extrapolating the optimal number of bins to larger (or smaller) datasets than the one used to compute it. 
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. 
norotnorm 
if true, a uniform density rather than normal density used for ROT selection. 
numdist 
number of distinct for selection. Used to speed up computation. 
numclust 
number of clusters for selection. Used to speed up computation. 

ROT number of bins, unregularized. 

ROT number of bins, regularized. 

ROT number of bins, unique knots. 

DPI number of bins. 

DPI number of bins, unique knots. 

A list containing options passed to the function, as well as total sample size 

A data frame containing grid. 
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 < binsregselect(y,x)
summary(est)

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