Learn R Programming

ivregEX (version 1.0)

plot.sensIvregEX: Plotting of Sensitivity Analyses

Description

Based on the output of sensIvreg creates plots of sensitive regions.

Usage

# S3 method for sensIvregEX
plot(x, effect = 0, ...)

Arguments

x

An object of class 'sensIvregEX', output of sensIvreg.

effect

Effect size (optional). Default value is 0.

Optional arguments for R plotting features.

See Also

plot.ivregDecision,

Examples

Run this code
# NOT RUN {
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)', effect = c(-.1, 0, .1, .15, .17), show = FALSE)

plot(z, nc = 3)

# }

Run the code above in your browser using DataLab