Description Usage Arguments Value Examples
get a particular parameter of interest from a cfa object
1 | getRes.CFA(cfaobj, fun, se = T, ...)
|
cfaobj |
a CFA object |
fun |
a function to apply for every value of the treatment in the cfaobj. The ccfa package provides several built-in functions: E (for expected value as a function of the treatment variable), Var (for the variance as a function of the treatment variable), IQR (the interquantile range as a function of the treatment variable), pov (the fraction of observations with outcomes below some threshold, as a function of the treatment variable), rich (the fraction of observations with outcomes above some threshold, as a function of the treatment variable), but other user-defined functions can be written. The requirement is that they need to take in an ecdf object and output a scalar result. |
se |
whether or not to compute standard errors |
... |
can pass additional arguments to fun using this argument |
CFASE object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | data(igm)
tvals <- seq(10,12,length.out=8)
yvals <- seq(quantile(igm$lcfincome, .05), quantile(igm$lcfincome, .95),
length.out=50)
## obtain counterfactual results
cfaresults <- cfa(lcfincome ~ lfincome, tvals=tvals, yvals=yvals, data=igm,
se=FALSE)
## get the average outcome (lfincome) as a function of the treatment
## variable (lfincome)
getRes.CFA(cfaresults, E, se=FALSE)
## get the variance of the outcomes as a function of the treatment
## variable
getRes.CFA(cfaresults, Var, se=FALSE)
## get the inter-quantile range of outcomes as a function of the
## treatment variable
getRes.CFA(cfaresults, IQR, se=FALSE, t1=0.9, t2=0.1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.