plot.ivregDecision: Plotting an object of class 'ivregDecision' or...

Description Usage Arguments Author(s) See Also Examples

View source: R/plot.ivregDecision.R

Description

An object of class 'ivregDecisionList', which is a list of objects of class 'ivregDecision', is output of 'sensIvreg.ivregEX'. This function gives you freedom to stylize a gray-scale plot of a sensitivity analysis.

Usage

1
2
3
4
5
6
7
## S3 method for class 'ivregDecision'
plot(x, xaxes = TRUE, yaxes = TRUE, xaxes.label = TRUE, 
		yaxes.label = TRUE, legend = TRUE, ...)
		
## S3 method for class 'ivregDecisionList'
plot(x, xaxes = TRUE, yaxes = TRUE, xaxes.label = TRUE, 
		yaxes.label = TRUE, legend = TRUE, subtitle =  TRUE, nc, ...)

Arguments

x

An object of class 'ivregDecision' or 'ivregDecisionList'. A decision matrix (or list of matrices) for given treatment effect(s) for different values of the sensitivity parameters.

xaxes, yaxes, xaxes.label, yaxes.label

Whether x-axis, y-axis and their labels to be added to the plots.

legend

whether a legend will be added to the plot.

subtitle

Logical for whether a subtitle to be added in a plot indicating the effect size of a 'ivregDecisionList' object.

nc

Optional integer for the number of columns in the plot.

...

Optional arguments for R plotting function.

Author(s)

Bikram Karmakar

See Also

plot.sensIvregEX

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data("CigarettesSW", package = "AER")
CigarettesSW$rprice <- with(CigarettesSW, price/cpi)
CigarettesSW$rincome <- with(CigarettesSW, income/population/cpi)
CigarettesSW$tdiff <- with(CigarettesSW, (taxs - tax)/cpi)


fm2 <- ivreg.EX(log(packs) ~ log(rprice) + log(rincome) | tdiff + log(rincome), 
		data = CigarettesSW, subset = year == "1995")
lmfit <- lm(log(packs) ~ log(rprice) + log(rincome), data = CigarettesSW, 
		subset = year == "1995")
res = coeftestIV(fm2, lmfit, 'log(rprice)')

z <- sensIvreg(fm2, res, 'log(rprice)', delta1 = seq(-.51, .51, .01), 
		effect = c(-.1, 0, .1, .15, .17))

plot(z$Z[[1]])
plot(z$Z, nc = 3)

ivregEX documentation built on May 1, 2019, 10:08 p.m.