ggplot2.CFA: ggplot2.CFA

Description Usage Arguments Value Examples

View source: R/cfa.R

Description

function for plotting results from counterfactual analysis using ggplot2

Usage

1
2
3
4
5
6
7
8
ggplot2.CFA(
  cfaseobj,
  setype = "pointwise",
  ylim = NULL,
  xlabel = NULL,
  ylabel = NULL,
  legend = FALSE
)

Arguments

cfaseobj

a CFASE object to plot

setype

whether to plot pointwise, uniform, or both standard errors

ylim

optional y limits on the plot

xlabel

optional x axis labels

ylabel

optional y axis labels

legend

boolean for whether or not to plot a legend (tends to look better with this option set to FALSE)

Value

ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
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
out <- cfa2(lcfincome ~ lfincome, tvals, yvals, igm, method1="qr",
xformla2=~HEDUC, method2="qr", iters=10, tau1=seq(.05,.95,.05),
tau2=seq(.05,.95,.05))

## get the difference between the average that adjusts for covariates and
## the one that does not
ggplot2.CFA(getResDiff.CFA(out$cfa1, out$cfa2, E), setype="uniform")

## End(Not run) 

WeigeHuangEcon/ccfa documentation built on Dec. 17, 2020, 7:36 p.m.