the same as cfa method except it computes two results at the same time which allows one to conduct inference on their difference

cfa2(
formla,
tvals,
yvals,
data,
xformla1 = NULL,
method1 = "dr",
tau1 = seq(0.01, 0.99, 0.01),
condDistobj1 = NULL,
xformla2 = NULL,
method2 = "dr",
tau2 = seq(0.01, 0.99, 0.01),
condDistobj2 = NULL,
se = TRUE,
iters = 100,
cl = 1
)

## Arguments

formla a formula y ~ treatment the values of the "treatment" to compute parameters of interest for the values to compute the counterfactual distribution for the data.frame where y, t, and x are an optional formula for the first set of x variables the first method for estimating the conditional distribution it can be "dr" for distribution regression or "qr" for quantile regression if using distribution regression, set the link variable. It can be any link function accepted by glm, e.g. logit, probit, cloglog if using quantile regression, the values of tau to use, the default is seq(.01,.99,.01) if have already calculated a conditional distribution object outside of the model, can set it here an optional formula for the second set of x variables the second method for estimating the conditional distribution it can be "dr" for distribution regression or "qr" for quantile regression if using distribution regression, set the link variable. It can be any link function accepted by glm, e.g. logit, probit, cloglog if using quantile regression, the values of tau to use, the default is seq(.01,.99,.01) if have already calculated a conditional distribution object outside of the model, can set it here whether or not to compute standard errors using the bootstrap how many bootstrap iterations to use how many clusters to use for parallel computation of standard errors

## Value

list of two CFA objects

## Examples

#' data(igm)
tvals <- seq(10,12,length.out=5)
yvals <- seq(quantile(igm$lcfincome, .05), quantile(igm$lcfincome, .95), length.out=50)

## obtain counterfactual results using quantile regression with
## no covariates and adjusting for education
cfa2(lcfincome ~ lfincome, tvals, yvals, igm, method1="qr", xformla2=~HEDUC,
method2="qr", se=FALSE, tau1=seq(.1,.9,.1), tau2=seq(.1,.9,.1))
#> Warning: Solution may be nonunique#> Warning: Solution may be nonunique#> Warning: Solution may be nonunique#> Warning: Solution may be nonunique#> Warning: Solution may be nonunique#> Warning: Solution may be nonunique#> Warning: Solution may be nonunique#> Warning: Solution may be nonunique#> Warning: Solution may be nonunique