## S3 method for class 'default':
sctest(x, order.by = NULL, functional = maxBB,
vcov = NULL, scores = estfun, decorrelate = TRUE, sandwich = TRUE,
parm = NULL, plot = FALSE, from = 0.1, to = NULL, nobs = NULL,
nrep = 50000, width = 0.15, xlab = NULL, \dots)scores
and associated variance-covariance matrix vcov.z or a formula with a single explanatory
variable like ~ z. The observations in the model
are ordered by the size of z. If set to NULL (the
default) the observations are assumefpFunctional object. For a list
of functionals see the details.vcov(x, order.by = order.by, data = data).
Alternatively, the character string "info", for details see
below.scores(x), by default
this is estfun.vcov the full sandwich
estimator or only the meat?functional is "supLM"
(or equivalently "maxLM"), from and to can be
passed to the supLM functional.functional is "maxLMo",
nobs and nrep are passed to the catL2BB functional.functional is "MOSUM",
the bandwidth width is passed to the maxMOSUM
functional.plot = TRUE)."htest" containing:sctest.default is a convenience interface to gefp for
structural change tests (or parameter instability tests) in general
parametric models. It proceeds in the following steps:scus <- gefp(x, fit = NULL, ...)where...comprises the argumentsorder.by,vcov,scores,decorrelate,sandwich,parmthat are simply passed on togefp.plot = TRUE) viaplot(scus, functional = functional, ...).sctest(scus, functional = functional).The main motivation for prociding the convenience interface is that these three steps can be easily carried out in one go along with a two convenience options:
gefp. This is always available based on thescores.
Additionally, by settingvcov = "info", the corresponding information
matrix can be used. Then the average information is assumed to be provided by
thevcovmethod for the model class. (Note that this is only sensible
for models estimated by maximum likelihood.)functionalby anefpFunctionalobject, the test labels employed by Merkle and Zeileis (2013) and Merkle, Fan,
and Zeileis (2013) can be used for convenience. Namely, for continuous numeric
orderings, the following functionals are available:functional = "DM"or"dmax"provides the double-maximum test (maxBB)."CvM"is the Cramer-von Mises functionalmeanL2BB."supLM"or equivalently"maxLM"is Andrews' supLM test
(supLM)."MOSUM"or"maxMOSUM"is the MOSUM
functional (maxMOSUM), and"range"is the range
functionalrangeBB. Furthermore, several functionals suitable
for (ordered) categoricalorder.byvariables are provided:"LMuo"is the unordered LM test (catL2BB),"WDMo"is the weighted double-maximum test for ordered variables
(ordwmax), and"maxLMo"is the maxLM test for
ordered variables (ordL2BB).The theoretical model class is introduced in Zeileis and Hornik (2007) with a
unifying view in Zeileis (2005), especially from an econometric perspective.
Zeileis (2006) introduces the underling computational tools gefp and
efpFunctional.
Merkle and Zeileis (2013) discuss the methods in the context of measurement invariance which is particularly relevant to psychometric models for cross section data. Merkle, Fan, and Zeileis (2013) extend the results to ordered categorical variables.
Zeileis, Shah, and Patnaik (2013) provide a unifying discussion in the context of time series methods, specifically in financial econometrics.
Merkle E.C., Fan J., Zeileis A. (2013), Testing for Measurement Invariance with Respect to an Ordinal Variable. Psychometrika, Forthcoming.
Zeileis A. (2005), A Unified Approach to Structural Change Tests Based on ML Scores, F Statistics, and OLS Residuals. Econometric Reviews, 24, 445--466. doi:10.1080/07474930500406053.
Zeileis A. (2006), Implementing a Class of Structural Change Tests: An Econometric Computing Approach. Computational Statistics & Data Analysis, 50, 2987--3008. doi:10.1016/j.csda.2005.07.001.
Zeileis A., Hornik K. (2007), Generalized M-Fluctuation Tests for Parameter Instability, Statistica Neerlandica, 61, 488--508. doi:10.1111/j.1467-9574.2007.00371.x.
Zeileis A., Shah A., Patnaik I. (2010), Testing, Monitoring, and Dating Structural Changes in Exchange Rate Regimes, Computational Statistics and Data Analysis, Forthcoming. doi:10.1016/j.csda.2009.12.005.
gefp, efpFunctional## Zeileis and Hornik (2007), Section 5.3, Figure 6
data("Grossarl")
m <- glm(cbind(illegitimate, legitimate) ~ 1, family = binomial, data = Grossarl,
subset = time(fraction) <= 1800)
sctest(m, order.by = 1700:1800, functional = "CvM")Run the code above in your browser using DataLab