Description Usage Arguments Value Examples
CA
conducts CA estimation and inference on userspecified objects of interest: first (weighted)
moment or (weighted) distribution. Users can use t
to specify variables in interest. When object
of interest is moment, use cl
to specify linear combinations for hypothesis testing. All estimates
are biascorrected and all confidence bands are monotonized. The bootstrap procedures follow algorithm 2.2
as in Chernozhukov, FernandezVal and Luo (2018).
1 2 3 4 5 6  CA(fm, data, method = "ols", var.type = "binary", var.T, compare,
subgroup = NULL, samp_weight = NULL, taus = c(1:9)/10, u = 0.1,
cl = matrix(c(1, 0), nrow = 2), t = c(1, 1, rep(0, dim(data)[2] 
2)), interest = "moment", cat = NULL, alpha = 0.1, B = 10,
ncores = 1, seed = 1, bc = TRUE, range.cb = c(0.5:99.5)/100,
boot.type = "nonpar")

fm 
Regression formula 
data 
The data in use (full sample or subpopulation in interset) 
method 
Models to be used for estimating partial effects. Four options: 
var.type 
The type of parameter in interest. Three options: 
var.T 
Variable T in interset. Should be a character. 
compare 
If parameter in interest is categorical, then user needs to specify which two category to
compare with. Should be a 1 by 2 character vector. For example, if the two levels to compare
with is 1 and 3, then 
subgroup 
Subgroup in interest. Default is 
samp_weight 
Sampling weight of data. If null then function implements empirical bootstrap.
If data specifies sampling weight, put that in and the function implements
weighted (i.i.d exponential weights) bootstrap. Default is 
taus 
Indexes for quantile regression. Default is 
u 
Percentile of most and least affected. Default is set to be 0.1. 
cl 
A prespecified linear combination. Should be a 2 by L matrix. Default is 
t 
An index for CA object. Should be a 1 by ncol(data) indicator vector. Users can either
(1) specify names of variables of interest directly, or
(2) use 1 to indicate the variable of interest. For example, total number of variables is 5 and interested in the 1st and 3rd vars, then specify

interest 
Generic objects in the least and most affected subpopulations. Two options:
(1) 
cat 
Pvalues in classification analysis are adjusted for multiplicity to account for joint testing of
zero coefficients on for all variables within a category. Specify all variables in interest in a list using numbers
to denote relative positions. For example, if variables in interest are "educ", "male", "female", "low income", "middle income",
and "high income", cat should be specified as 
alpha 
Size for confidence interval. Shoule be between 0 and 1. Default is 0.1 
B 
Number of bootstrap draws. Default is 10. For more accurate results, we recommend 500. 
ncores 
Number of cores for computation. Default is set to be 1. For large dataset, parallel computing is highly recommended since bootstrap is timeconsuming. 
seed 
Pseudonumber generation for reproduction. Default is 1. 
bc 
Whether want the estimate to be biascorrected. Default is 
range.cb 
When 
boot.type 
Type of bootstrap. Default is 
If subgroup = NULL
, all outputs are whole sample. Otherwise output are subgroup results. When
interest = "moment"
, the output is a list showing
est
Estimates of variables in interest.
bse
Bootstrap standard errors.
joint_p
Pvalues that are adjusted for multiplicity to account for joint testing for all variables.
If users have further specified cat
(e.g., !is.null(cat)
), the output has a fourth component
p_cat
Pvalues that are adjusted for multiplicity to account for joint testing for all variables within a category.
When interest = "dist"
, the output is a list of two components:
infresults
A list that stores estimates, upper and lower confidence bounds for all variables
in interest for least and most affected groups.
sortvar
A list that stores sorted and unique variables in interest.
We recommend using CAplot
command for result visualization.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  data("mortgage")
fm < deny ~ black + p_irat
t < c(rep(1, 2), rep(0, 14)) # Specify variables in interest
cl < matrix(c(1,0,0,1), nrow=2) # Meaning: show variables in interest for both groups
CA < CA(fm = fm, data = mortgage, var.T = "black", method = "logit", cl = cl, t = t)
# Tabulate the results
est < matrix(CA$est, ncol=2)
se < matrix(CA$bse, ncol=2)
Table < matrix(0, ncol=4, nrow=2)
Table[, 1] < est[, 1] # Least Affected Biascorrected estimate
Table[, 2] < se[, 1] # Corresponding SE
Table[, 3] < est[, 2] # Most affected
Table[, 4] < se[, 2] # Corresponding SE
rownames(Table) < colnames(CA$est)[1:2] # assign names to each row
colnames(Table) < rep(c("Estimate", "SE"), 2)

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