Description Usage Arguments Note Author(s) See Also Examples
View source: R/plot.sensIvregEX.R
Based on the output of sensIvreg
creates plots of sensitive regions.
1 2 |
x |
An object of class 'sensIvregEX', output of |
effect |
Effect size (optional). Default value is 0. |
... |
Optional arguments for R plotting features. |
This functionally creates two sets of plots, one a greyscale plot of the sensitivity analyses in the secondary instrumental variables analysis with independent EX analysis. Additionally it creates a plot of individual sensitivity regions for each analyses for the given effect size.
Bikram Karmakar
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.