Detect all outliers of a
carx object and update the model if any outlier is detected.
It tests for the presence of outliers one at a time, for each time point, adjusted for multiplicity of testing, as described in Wang and Chan (2017).
## S3 method for class 'carx' outlier(object, outlier.prefix = "OI_", seed = 131)
the prefix used to construct variable name for indicator variables representing the detected outliers, default = "OI_".
the seed for randon number generator, default=
carx object. If any outlier is detected, its index will be stored in the
outlier.indices attribute of the return object, and prefix for variable name is stored in the
outlier.prefix attribute. Note that if the original object is fitted through a formula interface, the formula will also be updated.
Wang C, Chan KS (2017). "Quasi-likelihood estimation of a censored autoregressive model with exogenous variables." Journal of the American Statistical Association. 2017 Mar 20(just-accepted).
1 2 3 4 5 6 7 8 9 10
sigma = 0.6 nObs = 100 dat = carxSimCenTS(nObs=nObs,sigma=sigma,ucl=Inf) dat$y[as.integer(nObs/2)] = dat$y[as.integer(nObs/2)] + 4*sd(dat$y) mdl <- carx(y~X1+X2-1,data=dat, p=2, CI.compute = FALSE) oc = outlier(mdl) #note the outlier indices in the output: print(oc) #note the updated formula: print(formula(oc))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.