File: sctest.formula.Rd

package info (click to toggle)
strucchange 1.5-1-2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 1,164 kB
  • sloc: makefile: 1
file content (89 lines) | stat: -rw-r--r-- 4,100 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
\name{sctest.formula}
\alias{sctest.formula}

\title{Structural Change Tests in Linear Regression Models}

\description{Performs tests for structural change in linear regression models.}

\usage{
\method{sctest}{formula}(formula, type = , h = 0.15,
    alt.boundary = FALSE, functional = c("max", "range",
    "maxL2", "meanL2"), from = 0.15, to = NULL, point = 0.5,
    asymptotic = FALSE, data, ...)
}

\arguments{
  \item{formula}{a formula describing the model to be tested.}
  \item{type}{a character string specifying the structural change test that is
     to be performed, the default is \code{"Rec-CUSUM"}. Besides the test
     types described in \code{\link{efp}}
     and \code{\link{sctest.Fstats}} the Chow test and the Nyblom-Hansen test
     can be performed by setting type to \code{"Chow"} or \code{"Nyblom-Hansen"},
     respectively.}
  \item{h}{numeric from interval (0,1) specifying the bandwidth. Determines the
     size of the data window relative to the sample size (for MOSUM and ME tests
     only).}
  \item{alt.boundary}{logical. If set to \code{TRUE} alternative boundaries
     (instead of the standard linear boundaries) will be used (for CUSUM
     processes only).}
  \item{functional}{indicates which functional should be used to aggregate
     the empirical fluctuation processes to a test statistic.}
 \item{from, to}{numeric. If \code{from} is smaller than 1 they are
     interpreted as percentages of data and by default \code{to} is taken to be
     the 1 - \code{from}. F statistics will be calculated for the observations
     \code{(n*from):(n*to)}, when \code{n} is the number of observations in the
     model. If \code{from} is greater than 1 it is interpreted to be the index
     and \code{to} defaults to \code{n - from}. (for F tests only)}
  \item{point}{parameter of the Chow test for the potential change point.
    Interpreted analogous to the \code{from} parameter. By
     default taken to be \code{floor(n*0.5)} if \code{n} is the  number of
     observations in the model.}
  \item{asymptotic}{logical. If \code{TRUE} the asymptotic (chi-square)
     distribution instead of the exact (F) distribution will be used to compute
     the p value (for Chow test only).}
  \item{data}{an optional data frame containing the variables in the model. By
     default the variables are taken from the environment which
     \code{sctest} is called from.}
  \item{...}{further arguments passed to \code{\link{efp}} or
     \code{\link{Fstats}}.} }

\details{
\code{sctest.formula} is a convenience interface for performing structural change
tests in linear regression models based on \code{\link{efp}} and \code{\link{Fstats}}.
It is mainly a wrapper for \code{\link{sctest.efp}}
and \code{\link{sctest.Fstats}} as it fits an empirical fluctuation process
first or computes the F statistics respectively and subsequently performs the
corresponding test. The Chow test and the Nyblom-Hansen test are available explicitly here.

An alternative convenience interface for performing structural change tests in general
parametric models (based on \code{\link{gefp}}) is available in \code{\link{sctest.default}}.
}

\value{
  An object of class \code{"htest"} containing:
  \item{statistic}{the test statistic,}
  \item{p.value}{the corresponding p value,}
  \item{method}{a character string with the method used,}
  \item{data.name}{a character string with the data name.}
}

\seealso{\code{\link{sctest.efp}}, \code{\link{sctest.Fstats}}, \code{\link{sctest.default}}}

\examples{
## Example 7.4 from Greene (1993), "Econometric Analysis"
## Chow test on Longley data
data("longley")
sctest(Employed ~ Year + GNP.deflator + GNP + Armed.Forces, data = longley,
  type = "Chow", point = 7)

## which is equivalent to segmenting the regression via
fac <- factor(c(rep(1, 7), rep(2, 9)))
fm0 <- lm(Employed ~ Year + GNP.deflator + GNP + Armed.Forces, data = longley)
fm1 <- lm(Employed ~ fac/(Year + GNP.deflator + GNP + Armed.Forces), data = longley)
anova(fm0, fm1)

## estimates from Table 7.5 in Greene (1993)
summary(fm0)
summary(fm1)
}
\keyword{htest}