View source: R/gets-isat-source.R
| isatloop | R Documentation |
Runs isat repeatedly at pre-specified significance levels to yield multiple iterations used in
outlierscaletest.
isatloop(num=c(seq(from=20, to=1, by=-1)), t.pval.spec = FALSE,
print=FALSE, y, ar=NULL, iis=TRUE, sis=FALSE, ...)
num |
numeric, target expected number of outliers under the null hypothesis, or target proportion of outliers if |
t.pval.spec |
logical, if |
print |
logical, if |
y |
numeric vector, time-series or |
ar |
integer vector, say, c(2,4) or 1:4. The AR-lags to include in the mean specification |
iis |
logical, whether to use |
sis |
logical, whether to use |
... |
any argument from |
The function repeatedly runs isat detecting outliers in a model of y at different chosen target levels of significance speciefied in num. The output of this function is used as the input for the outlierscaletest function. All additional arguments from isat can be passed to isatloop.
Returns a list of two items. The first item is the number of observations. The second item is a dataframe containing the expected and observed proportion (and number of outliers) for each specified significance level of selection.
Felix Pretis, https://felixpretis.climateeconometrics.org/
Jiao, X. & Pretis, F. (2019). Testing the Presence of Outliers in Regression Models. Discussion Paper.
Pretis, F., Reade, J., & Sucarrat, G. (2018). Automated General-to-Specific (GETS) regression modeling and indicator saturation methods for the detection of outliers and structural breaks. Journal of Statistical Software, 86(3).
isat, outlierscaletest
###Repeated isat models using the Nile dataset
### where p-values are chosen such that the expected number of outliers under the null
### corresponds to 1, 2, 3, 4 and 5.
nile <- as.zoo(Nile)
isat.nile.loop <- isatloop(y=nile, iis=TRUE, num=c(1,2, 3, 4, 5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.