Learn R Programming

ICSOutlier (version 0.4-0)

comp_norm_test: Selection of Nonnormal Invariant Components Using Marginal Normality Tests

Description

Identifies invariant coordinates that are non normal using univariate normality tests.

Usage

comp_norm_test(
  object,
  test = "agostino.test",
  type = "smallprop",
  level = 0.05,
  adjust = TRUE
)

Value

A list containing:

  • index: integer vector indicating the indices of the selected components.

  • test: string with the name of the normality test used.

  • criterion: vector of the p-values from the marginal normality tests for each component.

  • levels: vector of the levels used for the decision for each component.

  • adjust: logical. TRUE if adjusted.

  • type: type used

Arguments

object

object of class "ICS" where both S1 and S2 are specified as functions. The sample size and the dimension of interest are also obtained from the object.

test

name of the normality test to be used. Possibilites are "jarque.test", "anscombe.test", "bonett.test", "agostino.test", "shapiro.test". Default is "agostino.test".

type

currently the only option is "smallprop". See details.

level

the initial level used to make a decision based on the test p-values. See details.

adjust

logical. If TRUE, the quantiles levels are adjusted. Default is TRUE. See details.

Author

Aurore Archimbaud and Klaus Nordhausen

Details

Currently the only available type is "smallprop" which detects which of the components follow a univariately normal distribution. It starts from the first component and stops when a component is detected as gaussian. Five tests for univariate normality are available. See normal_crit() function for more general cases.

If adjust = FALSE all tests are performed at the same level. This leads however often to too many components. Therefore some multiple testing adjustments might be useful. The current default adjusts the level for the jth component as level/j.

Note that the function is seldomly called directly by the user but internally by ICS_outlier().

References

Archimbaud, A., Nordhausen, K. and Ruiz-Gazen, A. (2018), ICS for multivariate outlier detection with application to quality control. Computational Statistics & Data Analysis, 128:184-199. ISSN 0167-9473. tools:::Rd_expr_doi("10.1016/j.csda.2018.06.011").

See Also

ICS(), comp_simu_test(), jarque.test(), anscombe.test(), bonett.test(), bonett.test(), shapiro.test()

Examples

Run this code

Z <- rmvnorm(1000, rep(0, 6))
# Add 20 outliers on the first component
Z[1:20, 1] <- Z[1:20, 1] + 10
pairs(Z)
icsZ <- ICS(Z)
# The shift located outliers can be displayed in one dimension
comp_norm_test(icsZ)
# Only one invariant component is non normal and selected.
comp_norm_test(icsZ, test = "bonett.test")

# Example with no outlier
Z0 <- rmvnorm(1000, rep(0, 6))
pairs(Z0)
icsZ0 <-ICS(Z0)
# Should select no component
comp_norm_test(icsZ0, level = 0.01)$index

Run the code above in your browser using DataLab