Andrews.test: Andrews' Test for End-of-Sample Structural Change

Description Usage Arguments Value References Examples

Description

Performs Andrews' test for end-of-sample structural change, as described in \insertCiteandrews03CPAT. This function works for both univariate and multivariate data depending on the nature of x and whether formula is specified. This function is thus an interface to andrews_test and andrews_test_reg; see the documentation of those functions for more details.

Usage

1

Arguments

x

Data to test for change in mean (either a vector or data.frame)

M

Numeric index of the location of the first potential change point

formula

The regression formula, which will be passed to lm

Value

A htest-class object containing the results of the test

References

\insertAllCited

Examples

1
2
3
4
5
Andrews.test(rnorm(1000), M = 900)
x <- rnorm(1000)
y <- 1 + 2 * x + rnorm(1000)
df <- data.frame(x, y)
Andrews.test(df, y ~ x, M = 900)

Example output

Package 'CPAT' version 0.1.0
Type citation("CPAT") for citing this R package in publications

	Andrews' Test for Structural Change

data:  rnorm(1000)
S = 130.96, m = 100, p-value < 2.2e-16


	Andrews' Test for Structural Change

data:  df
S = 3.7757, m = 100, p-value = 0.03121

CPAT documentation built on May 1, 2019, 6:51 p.m.

Related to Andrews.test in CPAT...