View source: R/gets-isat-outlier-distortion-source.R
distorttest | R Documentation |
Implements the Jiao-Pretis-Schwarz test for coefficient distortion due to outliers by comparing coefficient estimates obtained using OLS to estimates obtained using the robust IIS estimator implemented using isat
. See the referenced Jiao-Pretis-Schwarz Paper below for more information.
distorttest(x, coef = "all")
x |
object of class |
coef |
Either "all" (Default) to test the distortion on all coefficients or a character vector of explanatory variable names. |
Object of class isat
Xiyu Jiao https://sites.google.com/view/xiyujiao
Felix Pretis https://felixpretis.climateeconometrics.org/
Moritz Schwarz https://moritzschwarz.org
Xiyu Jiao, Felix Pretis,and Moritz Schwarz. Testing for Coefficient Distortion due to Outliers with an Application to the Economic Impacts of Climate Change. Available at SSRN: https://www.ssrn.com/abstract=3915040 or \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2139/ssrn.3915040")}
isat, distorttestboot
## Not run:
data(Nile)
nile <- isat(Nile, sis=FALSE, iis=TRUE, plot=TRUE, t.pval=0.01)
distorttest(nile)
data("hpdata")
# Another example with co-variates
dat <- hpdata[,c("GD", "GNPQ", "FSDJ")]
Y <- ts(dat$GD,start = 1959, frequency = 4)
mxreg <- ts(dat[,c("GNPQ","FSDJ")],start = 1959, frequency = 4)
m1 <- isat(y = Y, mc = TRUE, sis = FALSE, iis = TRUE)
m2 <- isat(y = Y, mc = TRUE, sis = FALSE, iis = TRUE, ar = 1)
m3 <- isat(y = Y, mxreg = mxreg, mc = TRUE, sis = FALSE, iis = TRUE)
m4 <- isat(y = Y, mxreg = mxreg, mc = TRUE, sis = FALSE, iis = TRUE, ar = 1, t.pval = 0.01)
distorttest(m1, coef = "all")
distorttest(m2, coef = "all")
distorttest(m3, coef = "GNPQ")
distorttest(m4, coef = c("ar1", "FSDJ"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.