Title: | Unit Root and Cointegration Tests for Time Series Data |
---|---|
Description: | Unit root and cointegration tests encountered in applied econometric analysis are implemented. |
Authors: | Bernhard Pfaff [aut, cre], Eric Zivot [ctb], Matthieu Stigler [ctb] |
Maintainer: | Bernhard Pfaff <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.3-4 |
Built: | 2024-11-27 06:34:07 UTC |
Source: | CRAN |
This function estimates a restricted VAR, where the restrictions are
based upon , i.e. the loading vectors and
, i.e the matrix of cointegration vectors. The test
statistic is distributed as
with
degrees of
freedom, with
equal to the columns of the restricting matrix
,
equal to the columns of the restricting matrix
and
the order of the VAR.
ablrtest(z, H, A, r)
ablrtest(z, H, A, r)
z |
An object of class |
H |
The |
A |
The |
r |
The count of cointegrating relationships; |
The restricted matrix, as well as
is
normalised with respect to the first variable.
An object of class cajo.test
.
Bernhard Pfaff
Johansen, S. and Juselius, K. (1990), Maximum Likelihood Estimation and Inference on Cointegration – with Applications to the Demand for Money, Oxford Bulletin of Economics and Statistics, 52, 2, 169–210.
Johansen, S. (1991), Estimation and Hypothesis Testing of Cointegration Vectors in Gaussian Vector Autoregressive Models, Econometrica, Vol. 59, No. 6, 1551–1580.
ca.jo
, alrtest
, blrtest
,
cajo.test-class
, ca.jo-class
and
urca-class
.
data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, spec="longrun", season=4) HD1 <- matrix(c(1, -1, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1), c(5,3)) DA <- matrix(c(1,0,0,0, 0, 1, 0, 0, 0, 0, 0, 1), c(4,3)) summary(ablrtest(sjd.vecm, H=HD1, A=DA, r=1))
data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, spec="longrun", season=4) HD1 <- matrix(c(1, -1, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 1), c(5,3)) DA <- matrix(c(1,0,0,0, 0, 1, 0, 0, 0, 0, 0, 1), c(4,3)) summary(ablrtest(sjd.vecm, H=HD1, A=DA, r=1))
This functions estimates the matrix of a VECM.
The following OLS regression of the R-form of the VECM is hereby
utilised:
alphaols(z, reg.number = NULL)
alphaols(z, reg.number = NULL)
z |
An object of class |
reg.number |
The number of the equation in the R-form that should
be estimated or if set to |
The cointegrating relations, i.e. are calculated by using
z@RK
and z@V
.
Returns an object of class lm
.
Bernhard Pfaff
Johansen, S. (1988), Statistical Analysis of Cointegration Vectors, Journal of Economic Dynamics and Control, 12, 231–254.
Johansen, S. and Juselius, K. (1990), Maximum Likelihood Estimation and Inference on Cointegration – with Applications to the Demand for Money, Oxford Bulletin of Economics and Statistics, 52, 2, 169–210.
Johansen, S. (1991), Estimation and Hypothesis Testing of Cointegration Vectors in Gaussian Vector Autoregressive Models, Econometrica, Vol. 59, No. 6, 1551–1580.
ca.jo
, lm
, ca.jo-class
and urca-class
.
data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm1 <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, spec="longrun", season=4) summary(alphaols(sjd.vecm1)) summary(alphaols(sjd.vecm1, reg.number=1))
data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm1 <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, spec="longrun", season=4) summary(alphaols(sjd.vecm1)) summary(alphaols(sjd.vecm1, reg.number=1))
This function estimates a restricted VAR, where the restrictions are
base upon , i.e. the loading vectors. The test
statistic is distributed as
with
degrees of
freedom, with
equal to the columns of the restricting matrix
.
alrtest(z, A, r)
alrtest(z, A, r)
z |
An object of class |
A |
The |
r |
The count of cointegration relationships; |
The orthogonal matrix to can be accessed as
object@B
. The restricted matrix is
normalised with respect to the first variable.
An object of class cajo.test
.
Bernhard Pfaff
Johansen, S. and Juselius, K. (1990), Maximum Likelihood Estimation and Inference on Cointegration – with Applications to the Demand for Money, Oxford Bulletin of Economics and Statistics, 52, 2, 169–210.
Johansen, S. (1991), Estimation and Hypothesis Testing of Cointegration Vectors in Gaussian Vector Autoregressive Models, Econometrica, Vol. 59, No. 6, 1551–1580.
ca.jo
, blrtest
, ablrtest
,
cajo.test-class
, ca.jo-class
and
urca-class
.
data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, spec="longrun", season=4) DA <- matrix(c(1,0,0,0), c(4,1)) summary(alrtest(sjd.vecm, A=DA, r=1))
data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, spec="longrun", season=4) DA <- matrix(c(1,0,0,0), c(4,1)) summary(alrtest(sjd.vecm, A=DA, r=1))
This function estimates a restricted VAR, where some of the
cointegration vectors are known. The known cointegration relationships
have to be provided in an matrix
. The test
statistic is distributed as
with
degrees of
freedom, with
equal to total number of cointegration relations.
bh5lrtest(z, H, r)
bh5lrtest(z, H, r)
z |
An object of class |
H |
The |
r |
The count of cointegrating relationships; |
Please note, that the number of columns of must be
smaller than the count of cointegration relations
.
An object of class cajo.test
.
Bernhard Pfaff
Johansen, S. (1995), Likelihood-Based Inference in Cointegrated Vector Autoregressive Models, Oxford University Press, Oxford.
Johansen, S. and Juselius, K. (1992), Testing structural hypotheses in a multivariate cointegration analysis of the PPP and the UIP for UK, Journal of Econometrics, 53, 211–244.
ca.jo
, alrtest
, ablrtest
,
blrtest
, bh6lrtest
, cajo.test-class
,
ca.jo-class
and urca-class
.
data(UKpppuip) attach(UKpppuip) dat1 <- cbind(p1, p2, e12, i1, i2) dat2 <- cbind(doilp0, doilp1) H1 <- ca.jo(dat1, type='trace', K=2, season=4, dumvar=dat2) H51 <- c(1, -1, -1, 0, 0) H52 <- c(0, 0, 0, 1, -1) summary(bh5lrtest(H1, H=H51, r=2)) summary(bh5lrtest(H1, H=H52, r=2))
data(UKpppuip) attach(UKpppuip) dat1 <- cbind(p1, p2, e12, i1, i2) dat2 <- cbind(doilp0, doilp1) H1 <- ca.jo(dat1, type='trace', K=2, season=4, dumvar=dat2) H51 <- c(1, -1, -1, 0, 0) H52 <- c(0, 0, 0, 1, -1) summary(bh5lrtest(H1, H=H51, r=2)) summary(bh5lrtest(H1, H=H52, r=2))
This function estimates a restricted VAR, where some restrictions are
placed on cointegrating relations which are chosen in the
space of the matrix H. The test statistic is distributed as
with
degrees of freedom, with
equal to the number of columns of
,
the number
of cointegrating relations in the first partition and
the
number of cointegrating relations in the second partition which will
be estimated without any restrictions.
bh6lrtest(z, H, r, r1, conv.val = 0.0001, max.iter = 50)
bh6lrtest(z, H, r, r1, conv.val = 0.0001, max.iter = 50)
z |
An object of class |
H |
The |
r |
The count of cointegrating relationships; |
r1 |
The count of cointegrating relationships in the first
partition of the cointegration space; |
conv.val |
The convergence value of the algorithm. (see details); |
max.iter |
The maximal number of iterations. |
Please note, that the following ordering of the dimensions should be
obeyed: . A two-step algorithm is used to
determine the eigen values of the restricted model. Convergence is
achieved if the quadratic norm of the eigen values is smaller than
conv.val
.
An object of class cajo.test
.
Bernhard Pfaff
Johansen, S. (1995), Likelihood-Based Inference in Cointegrated Vector Autoregressive Models, Oxford University Press, Oxford.
Johansen, S. and Juselius, K. (1992), Testing structural hypotheses in a multivariate cointegration analysis of the PPP and the UIP for UK, Journal of Econometrics, 53, 211–244.
ca.jo
, alrtest
, ablrtest
,
blrtest
, bh5lrtest
, cajo.test-class
,
ca.jo-class
and urca-class
.
data(UKpppuip) attach(UKpppuip) dat1 <- cbind(p1, p2, e12, i1, i2) dat2 <- cbind(doilp0, doilp1) H1 <- ca.jo(dat1, type='trace', K=2, season=4, dumvar=dat2) H6 <- matrix(c(1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0), c(5,3)) bh6lrtest(z=H1, H=H6, r=2, r1=1, conv.val=0.0001, max.iter=50)
data(UKpppuip) attach(UKpppuip) dat1 <- cbind(p1, p2, e12, i1, i2) dat2 <- cbind(doilp0, doilp1) H1 <- ca.jo(dat1, type='trace', K=2, season=4, dumvar=dat2) H6 <- matrix(c(1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0), c(5,3)) bh6lrtest(z=H1, H=H6, r=2, r1=1, conv.val=0.0001, max.iter=50)
This function estimates a restricted VAR, where the restrictions are
base upon , i.e. the cointegration vectors. The test
statistic is distributed as
with
degrees of
freedom, with
equal to the columns of the restricting matrix
.
blrtest(z, H, r)
blrtest(z, H, r)
z |
An object of class |
H |
The |
r |
The count of cointegrating relationships; |
Please note, that in the case of nested hypothesis, the reported
p-value should be adjusted to (see Johansen, S. and
K. Juselius (1990)).
An object of class cajo.test
.
Bernhard Pfaff
Johansen, S. (1988), Statistical Analysis of Cointegration Vectors, Journal of Economic Dynamics and Control, 12, 231–254.
Johansen, S. and Juselius, K. (1990), Maximum Likelihood Estimation and Inference on Cointegration – with Applications to the Demand for Money, Oxford Bulletin of Economics and Statistics, 52, 2, 169–210.
Johansen, S. (1991), Estimation and Hypothesis Testing of Cointegration Vectors in Gaussian Vector Autoregressive Models, Econometrica, Vol. 59, No. 6, 1551–1580.
ca.jo
, alrtest
, ablrtest
,
bh5lrtest
, bh6lrtest
, cajo.test-class
,
ca.jo-class
and urca-class
.
data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm <- ca.jo(sjd, ecdet="const", type="eigen", K=2, spec="longrun", season=4) HD0 <- matrix(c(-1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1), c(5,4)) summary(blrtest(sjd.vecm, H=HD0, r=1))
data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm <- ca.jo(sjd, ecdet="const", type="eigen", K=2, spec="longrun", season=4) HD0 <- matrix(c(-1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1), c(5,4)) summary(blrtest(sjd.vecm, H=HD0, r=1))
Conducts the Johansen procedure on a given data set. The
"trace"
or "eigen"
statistics are reported and the
matrix of eigenvectors as well as the loading matrix.
ca.jo(x, type = c("eigen", "trace"), ecdet = c("none", "const", "trend"), K = 2, spec=c("longrun", "transitory"), season = NULL, dumvar = NULL)
ca.jo(x, type = c("eigen", "trace"), ecdet = c("none", "const", "trend"), K = 2, spec=c("longrun", "transitory"), season = NULL, dumvar = NULL)
x |
Data matrix to be investigated for cointegration. |
type |
The test to be conducted, either ‘ |
ecdet |
Character, ‘ |
K |
The lag order of the series (levels) in the VAR. |
spec |
Determines the specification of the VECM, see details below. |
season |
If seasonal dummies should be included, the data frequency must be set accordingly, i.e ‘4’ for quarterly data. |
dumvar |
If dummy variables should be included, a matrix with
row dimension equal to |
Given a general VAR of the form:
the following two specifications of a VECM exist:
where
and
The matrices contain the cumulative long-run
impacts, hence if
spec="longrun"
is choosen, the above VECM is
estimated.
The other VECM specification is of the form:
where
and
The matrix is the same as in the first specification.
However, the
matrices now differ, in the sense
that they measure transitory effects, hence by setting
spec="transitory"
the second VECM form is estimated. Please note
that inferences drawn on will be the same, regardless
which specification is choosen and that the explanatory power is the
same, too.
If "season"
is not NULL, centered seasonal dummy variables are
included.
If "dumvar"
is not NULL, a matrix of dummy variables is included
in the VECM. Please note, that the number of rows of the matrix
containing the dummy variables must be equal to the row number of
x
.
Critical values are only reported for systems with less than 11 variables and are taken from Osterwald-Lenum.
An object of class ca.jo
.
Bernhard Pfaff
Johansen, S. (1988), Statistical Analysis of Cointegration Vectors, Journal of Economic Dynamics and Control, 12, 231–254.
Johansen, S. and Juselius, K. (1990), Maximum Likelihood Estimation and Inference on Cointegration – with Applications to the Demand for Money, Oxford Bulletin of Economics and Statistics, 52, 2, 169–210.
Johansen, S. (1991), Estimation and Hypothesis Testing of Cointegration Vectors in Gaussian Vector Autoregressive Models, Econometrica, Vol. 59, No. 6, 1551–1580.
Osterwald-Lenum, M. (1992), A Note with Quantiles of the Asymptotic Distribution of the Maximum Likelihood Cointegration Rank Test Statistics, Oxford Bulletin of Economics and Statistics, 55, 3, 461–472.
plotres
, alrtest
, ablrtest
,
blrtest
, cajolst
, cajools
,
lttest
, ca.jo-class
and urca-class
.
data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, spec="longrun", season=4) summary(sjd.vecm) # data(finland) sjf <- finland sjf.vecm <- ca.jo(sjf, ecdet = "none", type="eigen", K=2, spec="longrun", season=4) summary(sjf.vecm)
data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, spec="longrun", season=4) summary(sjd.vecm) # data(finland) sjf <- finland sjf.vecm <- ca.jo(sjf, ecdet = "none", type="eigen", K=2, spec="longrun", season=4) summary(sjf.vecm)
This class contains the relevant information by applying the Johansen procedure to a matrix of time series data.
x
:Object of class "ANY"
: A data matrix, or an
object that can be coerced to it.
Z0
:Object of class "matrix"
: The matrix of the
differenced series.
Z1
:Object of class "matrix"
: The regressor
matrix, except for the lagged variables in levels.
ZK
:Object of class "matrix"
: The matrix of the
lagged variables in levels.
type
:Object of class "character"
: The type of the
test, either "trace"
or "eigen"
.
model
:Object of class "character"
: The model
description in prose, with respect to the inclusion of a linear
trend.
ecdet
:Object of class "character"
: Specifies
the deterministic term to be included in the cointegration
relation. This can be either "none", "const", or "trend".
lag
:Object of class "integer"
: The lag order
for the variables in levels.
P
:Object of class "integer"
: The count of
variables.
season
:Object of class "ANY"
: The frequency of
the data, if seasonal dummies should be included, otherwise NULL.
dumvar
:Object of class "ANY"
: A matrix
containing dummy variables. The row dimension must be equal to
x
, otherwise NULL.
cval
:Object of class "ANY"
: The critical
values of the test at the 1%, 5% and 10% level of significance.
teststat
:Object of class "ANY"
: The values
of the test statistics.
lambda
:Object of class "vector"
: The eigenvalues.
Vorg
:Object of class "matrix"
: The matrix of
eigenvectors, such that .
V
:Object of class "matrix"
: The matrix of
eigenvectors, normalised with respect to the first variable.
W
:Object of class "matrix"
: The matrix of
loading weights.
PI
:Object of class "matrix"
: The coeffcient
matrix of the lagged variables in levels.
DELTA
:Object of class "matrix"
: The
variance/covarinace matrix of V
.
GAMMA
:Object of class "matrix"
: The
coeffecient matrix of Z1
.
R0
:Object of class "matrix"
: The matrix of
residuals from the regressions in differences.
RK
:Object of class "matrix"
: The matrix of
residuals from the regression in lagged levels.
bp
:Object of class "ANY"
: Potential break
point, only set if function cajolst
is called, otherwise
NA
.
test.name
:Object of class "character"
: The
name of the test, i.e. ‘Johansen-Procedure’.
spec
:Object of class "character"
: The
specification of the VECM.
call
:Object of class "call"
: The
call of function ca.jo
.
Class urca
, directly.
Type showMethods(classes="ca.jo")
at the R prompt for a
complete list of methods which are available for this class.
Useful methods include
show
:test statistic.
summary
:like show, but critical values, eigenvectors and loading matrix added.
plot
:The series of the VAR and their potential cointegration relations.
Bernhard Pfaff
Johansen, S. (1988), Statistical Analysis of Cointegration Vectors, Journal of Economic Dynamics and Control, 12, 231–254.
Johansen, S. and Juselius, K. (1990), Maximum Likelihood Estimation and Inference on Cointegration – with Applications to the Demand for Money, Oxford Bulletin of Economics and Statistics, 52, 2, 169–210.
Johansen, S. (1991), Estimation and Hypothesis Testing of Cointegration Vectors in Gaussian Vector Autoregressive Models, Econometrica, Vol. 59, No. 6, 1551–1580.
ca.jo
, plotres
and urca-class
.
Performs the Phillips and Ouliaris "Pu"
and "Pz"
cointegration test.
ca.po(z, demean = c("none", "constant", "trend"), lag = c("short", "long"), type = c("Pu", "Pz"), tol = NULL)
ca.po(z, demean = c("none", "constant", "trend"), lag = c("short", "long"), type = c("Pu", "Pz"), tol = NULL)
z |
Data matrix to be investigated for cointegration. |
demean |
The method for detrending the series, either
|
lag |
Either a short or long lag number used for variance/covariance correction. |
type |
The test type, either |
tol |
Numeric, this argument is passed to |
The test "Pz"
, compared to the test "Pu"
, has the
advantage that it is invariant to the normalization of the
cointegration vector, i.e. it does not matter which variable
is on the left hand side of the equation. In case convergence
problems are encountered by matrix inversion, one can pass a higher
tolerance level via "tol=..."
to the solve()
-function.
An object of class ca.po
.
Bernhard Pfaff
Phillips, P.C.B. and Ouliaris, S. (1990), Asymptotic Properties of Residual Based Tests for Cointegration, Econometrica, Vol. 58, No. 1, 165–193.
data(ecb) m3.real <- ecb[,"m3"]/ecb[,"gdp.defl"] gdp.real <- ecb[,"gdp.nom"]/ecb[,"gdp.defl"] rl <- ecb[,"rl"] ecb.data <- cbind(m3.real, gdp.real, rl) m3d.po <- ca.po(ecb.data, type="Pz") summary(m3d.po)
data(ecb) m3.real <- ecb[,"m3"]/ecb[,"gdp.defl"] gdp.real <- ecb[,"gdp.nom"]/ecb[,"gdp.defl"] rl <- ecb[,"rl"] ecb.data <- cbind(m3.real, gdp.real, rl) m3d.po <- ca.po(ecb.data, type="Pz") summary(m3d.po)
This class contains the relevant information by applying the Phillips and Ouliaris cointegration test to a data matrix.
z
:Object of class "ANY"
: A data matrix, or an
object that can be coerced to it.
type
:Object of class "character"
: The type of
the test, either the "Pu"
-test or the normalisation
invariant "Pz"
-test.
model
:Object of class "character"
: Determines
how the series should be detrended.
lag
:Object of class "integer"
: The lags used
for variance/covariance correction.
cval
:Object of class "matrix"
: The critical
values of the test at the 1%, 5% and 10% level of significance.
res
:Object of class "matrix"
: The residuals of
the the cointegration regression(s).
teststat
:Object of class "numeric"
: The value
of the test statistic.
testreg
:Object of class "ANY"
: The summary
output of the cointegration regression(s).
test.name
:Object of class "character"
: The
name of the test, i.e. ‘Phillips and Ouliaris’.
Class urca
, directly.
Type showMethods(classes="ca.po")
at the R prompt for a
complete list of methods which are available for this class.
Useful methods include
show
:test statistic.
summary
:like show, but critical value and summary of test regression(s) added.
plot
:Residual plot(s) and their acfs' and pacfs'.
Bernhard Pfaff
Phillips, P.C.B. and Ouliaris, S. (1990), Asymptotic Properties of Residual Based Tests for Cointegration, Econometrica, Vol. 58, No. 1, 165–193.
ca.po
and urca-class
.
This class contains the relevant information by estimating and testing
a VAR under linear restrictions on and
.
Z0
:Object of class "matrix"
: The matrix of the
differenced series.
Z1
:Object of class "matrix"
: The regressor
matrix, except for the lagged variables in levels.
ZK
:Object of class "matrix"
: The matrix of the
lagged variables in levels.
ecdet
:Object of class "character"
: Specifies
the deterministic term to be included in the cointegration
relation. This can be either "none", "const", or "trend".
H
:Object of class "ANY"
: The matrix
containing the restrictions placed upon .
A
:Object of class "ANY"
: The matrix
containing the restrictions placed upon .
B
:Object of class "ANY"
: The matrix
orthogonal to matrix .
type
:Object of class "character"
: The test type.
teststat
:Object of class "numeric"
: The value
of the test statistic.
pval
:Object of class "vector"
: The p-value and
the degrees of freedom.
lambda
:Object of class "vector"
: The
eigenvalues of the restricted model.
Vorg
:Object of class "matrix"
: The matrix of
eigenvectors, such that .
V
:Object of class "matrix"
: The matrix of the
restricted eigenvectors, normalised with respect to the first variable.
W
:Object of class "matrix"
: The matrix of the
corresponding loading weights.
PI
:Object of class "matrix"
: The coefficient
matrix of the lagged variables in levels.
DELTA
:Object of class "ANY"
: The
variance/covarinace matrix of .
DELTA.bb
:Object of class "ANY"
: The
variance/covarinace matrix of the marginal factor
.
DELTA.ab
:Object of class "ANY"
: The
variance/covarinace matrix of the conditional distribution of
and
.
DELTA.aa.b
:Object of class "ANY"
: The
variance/covarinace matrix of the restricted loading matrix.
GAMMA
:Object of class "matrix"
: The
coefficient matrix of .
test.name
:Object of class "character"
: The
name of the test, i.e. ‘Johansen-Procedure’.
Class urca
, directly.
Type showMethods(classes="cajo.test")
at the R prompt for a
complete list of methods which are available for this class.
Useful methods include
show
:test-statistic.
summary
:like show, but p-value of test statistic,
restricted eigenvectors, loading matrix and restriction matrices
and
, where applicable, added.
Bernhard Pfaff
Johansen, S. (1988), Statistical Analysis of Cointegration Vectors, Journal of Economic Dynamics and Control, 12, 231–254.
Johansen, S. and Juselius, K. (1990), Maximum Likelihood Estimation and Inference on Cointegration – with Applications to the Demand for Money, Oxford Bulletin of Economics and Statistics, 52, 2, 169–210.
Johansen, S. (1991), Estimation and Hypothesis Testing of Cointegration Vectors in Gaussian Vector Autoregressive Models, Econometrica, Vol. 59, No. 6, 1551–1580.
ablrtest
, alrtest
, blrtest
,
ca.jo
, ca.jo-class
and urca-class
.
The function cajolst
implements the procedure by Luetkepohl
et al. to test for the cointegration rank of a VAR process with
a level shift at an unknown time.
cajolst(x, trend = TRUE, K = 2, season = NULL)
cajolst(x, trend = TRUE, K = 2, season = NULL)
x |
Data matrix to be investigated for cointegration. |
trend |
A linear trend is included in the auxiliary regressions
for data adjustment (default is |
K |
The lag order of the series (levels) in the VAR, must be at
least equal to |
season |
If seasonal dummies should be included, the data frequency must be set accordingly, i.e ‘4’ for quarterly data. |
Note, that the slot "x"
of the returned object contains the
adjusted data series, that is, a matrix adjusted for the temptative
break point, and if applicable, a linear trend and/or seasonal
effects. The VECM is then estimated and tested for cointegration rank
subject to the adjusted matrix. The break point is contained in the
slot "bp"
. Please note, that the transitory VECM
specification is estimated and that only the trace test is
available. The critical values are taken from Trenkler, Carsten (2003).
Returns an object of class ca.jo
.
Bernhard Pfaff
L\"utkepohl, H., Saikkonen, P. and Trenkler, C. (2004), Testing for the Cointegrating Rank of a VAR Process with Level Shift at Unknown Time, Econometrica, Vol. 72, No. 2, 647–662.
Trenkler, Carsten (2003), A new set of critical values for systems cointegration tests with a prior adjustment for deterministic terms, Economics Bulletin, Vol. 3, No. 11, 1–9.
plotres
, alrtest
, ablrtest
,
blrtest
, ca.jo
, cajools
,
lttest
, ca.jo-class
and urca-class
.
data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.lst <- cajolst(sjd, trend=TRUE, K=2, season=4) summary(sjd.lst)
data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.lst <- cajolst(sjd, trend=TRUE, K=2, season=4) summary(sjd.lst)
This function returns the OLS regressions of an unrestricted VECM,
i.e. it returns an object of class lm
. The user can provide a
certain number of which equation in the VECM should be estimated and
reported, or if "reg.number=NULL"
each equation in the VECM
will be estimated and its results are reported.
cajools(z, reg.number = NULL)
cajools(z, reg.number = NULL)
z |
An object of class |
reg.number |
The number of the equation in the VECM that should
be estimated or if set to |
Returns an object of class lm
.
Bernhard Pfaff
Johansen, S. (1988), Statistical Analysis of Cointegration Vectors, Journal of Economic Dynamics and Control, 12, 231–254.
Johansen, S. and Juselius, K. (1990), Maximum Likelihood Estimation and Inference on Cointegration – with Applications to the Demand for Money, Oxford Bulletin of Economics and Statistics, 52, 2, 169–210.
Johansen, S. (1991), Estimation and Hypothesis Testing of Cointegration Vectors in Gaussian Vector Autoregressive Models, Econometrica, Vol. 59, No. 6, 1551–1580.
ca.jo
, cajorls
, lm
,
ca.jo-class
and urca-class
.
data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm1 <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, spec="longrun", season=4) sjd.vecm2 <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, spec="transitory", season=4) sjd.vecm.ols1 <- cajools(sjd.vecm1) sjd.vecm.ols2 <- cajools(sjd.vecm2) summary(sjd.vecm.ols1) summary(sjd.vecm.ols2)
data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm1 <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, spec="longrun", season=4) sjd.vecm2 <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, spec="transitory", season=4) sjd.vecm.ols1 <- cajools(sjd.vecm1) sjd.vecm.ols2 <- cajools(sjd.vecm2) summary(sjd.vecm.ols1) summary(sjd.vecm.ols2)
This function returns the OLS regressions of a restricted VECM,
i.e. it returns a list object with elements of class ‘lm’
containing the restricted VECM and a matrix object with the normalised
cointegrating relationships. The user can provide a certain number of
which equation in the VECM should be estimated and reported, or if
"reg.number = NULL"
each equation in the VECM will be estimated
and its results are reported. Furthermore, the cointegratioon rank has
to be supplied too.
cajorls(z, r = 1, reg.number = NULL)
cajorls(z, r = 1, reg.number = NULL)
z |
An object of class |
r |
An integer, signifiying the cointegration rank. |
reg.number |
The number of the equation in the VECM that should
be estimated or if set to |
The cointegration space is normalised as , with
.
Returns a list object with elements of class lm
for the
restricted VECM and a matrix object with the normalised cointegrating
vectors.
Bernhard Pfaff
Johansen, S. (1995), Likelihood-Based Inference in Cointegrated Vector Autoregressive Models, Oxford University Press, Oxford.
Lütkepohl, H. (2006), New Introduction to Multiple Time Series Analysis, Springer, New York.
ca.jo
, cajools
, lm
,
ca.jo-class
and urca-class
.
data(finland) sjf <- finland sjf.vecm <- ca.jo(sjf, ecdet = "none", type = "eigen", K = 2, spec = "longrun", season = 4) sjf.vecm.rls <- cajorls(sjf.vecm, r = 2) summary(sjf.vecm.rls$rlm) sjf.vecm.rls$beta
data(finland) sjf <- finland sjf.vecm <- ca.jo(sjf, ecdet = "none", type = "eigen", K = 2, spec = "longrun", season = 4) sjf.vecm.rls <- cajorls(sjf.vecm, r = 2) summary(sjf.vecm.rls$rlm) sjf.vecm.rls$beta
This data set contains the series used by S. Johansen and K. Juselius for estimating a money demand function of Denmark.
data(denmark)
data(denmark)
A data frame with 55 observations on the following 6 variables.
period |
Time index from 1974:Q1 until 1987:Q3. |
LRM |
Logarithm of real money, M2. |
LRY |
Logarithm of real income. |
LPY |
Logarithm of price deflator. |
IBO |
Bond rate. |
IDE |
Bank deposit rate. |
Bernhard Pfaff
Johansen, S. and Juselius, K. (1990), Maximum Likelihood Estimation and Inference on Cointegration – with Applications to the Demand for Money, Oxford Bulletin of Economics and Statistics, 52, 2, 169–210.
This data set contains some macroeconomic figures of the Euro Zone in order to estimate an exemplary money demand function.
data(ecb)
data(ecb)
A data frame containing five series.
period |
Time index from Q31997 until Q42003. |
gdp.defl |
Gross Domestic Product Deflator, |
[Index 2000=100, seasonally adjusted] | |
gdp.nom |
Nominal Gross Domestic Product, |
[Current prices, EUR billions, seasonally adjusted] | |
m3 |
Monetary Aggregate M3, |
[outstanding amount at end of quarter, EUR billions, seasonally adjusted] | |
rl |
Benchmark Government Bond yield with a maturity of 10 years, |
[percentages per annum, average of last quarter's month]. |
Bernhard Pfaff
European Central Bank, Monthly Bulletins, Frankfurt am Main, Germany.
This data set contains the series used by S. Johansen and K. Juselius for estimating a money demand function of Finland.
data(finland)
data(finland)
A data frame with 106 observations on the following 4 variables, ranging from 1958:Q2 until 1984:Q3.
lrm1 |
Logarithm of real money, M1. |
lny |
Logarithm of real income. |
lnmr |
Marginal rate of interest. |
difp |
Inflation rate. |
Bernhard Pfaff
Johansen, S. and Juselius, K. (1990), Maximum Likelihood Estimation and Inference on Cointegration – with Applications to the Demand for Money, Oxford Bulletin of Economics and Statistics, 52, 2, 169–210.
Conducts a likelihood ratio test for no inclusion of a linear trend in a
VAR. That is, the Null hypothesis is for not including a linear trend
and is assigned as 'H2*(r)'. The test statistic is distributed as
square with
degrees of freedom.
lttest(z, r)
lttest(z, r)
z |
An object of class ‘ca.jo’. |
r |
The count of cointegrating relationships. |
The count of cointegrating relations should be given as integer and
should be in the interval .
lttest |
Matrix containing the value of the test statistic and its p-value. |
Bernhard Pfaff
Johansen, S. and Juselius, K. (1990), Maximum Likelihood Estimation and Inference on Cointegration – with Applications to the Demand for Money, Oxford Bulletin of Economics and Statistics, 52, 2, 169–210.
Johansen, S. (1991), Estimation and Hypothesis Testing of Cointegration Vectors in Gaussian Vector Autoregressive Models, Econometrica, Vol. 59, No. 6, 1551–1580.
ca.jo
and ca.jo-class
.
data(denmark) sjd <- as.matrix(denmark[, c("LRM", "LRY", "IBO", "IDE")]) sjd.vecm <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, spec="longrun", season=4) lttest(sjd.vecm, r=1) # data(finland) sjf <- as.matrix(finland) sjf.vecm <- ca.jo(sjf, ecdet = "none", type="eigen", K=2, spec="longrun", season=4) lttest(sjf.vecm, r=3)
data(denmark) sjd <- as.matrix(denmark[, c("LRM", "LRY", "IBO", "IDE")]) sjd.vecm <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, spec="longrun", season=4) lttest(sjd.vecm, r=1) # data(finland) sjf <- as.matrix(finland) sjf.vecm <- ca.jo(sjf, ecdet = "none", type="eigen", K=2, spec="longrun", season=4) lttest(sjf.vecm, r=3)
A collection and description of functions
to compute the distribution and and quantile
function for MacKinnon's unit root test statistics.
The functions are:
punitroot |
the returns cumulative probability, |
qunitroot |
the returns quantiles of the unit root test statistics, |
unitrootTable |
tables p values from MacKinnon's response surface. |
punitroot(q, N = Inf, trend = c("c", "nc", "ct", "ctt"), statistic = c("t", "n"), na.rm = FALSE) qunitroot(p, N = Inf, trend = c("c", "nc", "ct", "ctt"), statistic = c("t", "n"), na.rm = FALSE) unitrootTable(trend = c("c", "nc", "ct", "ctt"), statistic = c("t", "n"))
punitroot(q, N = Inf, trend = c("c", "nc", "ct", "ctt"), statistic = c("t", "n"), na.rm = FALSE) qunitroot(p, N = Inf, trend = c("c", "nc", "ct", "ctt"), statistic = c("t", "n"), na.rm = FALSE) unitrootTable(trend = c("c", "nc", "ct", "ctt"), statistic = c("t", "n"))
N |
the number of observations in the sample from which the
quantiles are to be computed. |
na.rm |
a logical value. If set to |
p |
a numeric vector of probabilities. Missing values are allowed. |
q |
vector of quantiles or test statistics. Missing values are allowed. |
statistic |
a character string describing the type of test statistic.
Valid choices are |
trend |
a character string describing the regression from which the
quantiles are to be computed. Valid choices are: |
The function punitroot
returns the cumulative probability
of the asymptotic or finite sample distribution of the unit root
test statistics.
The function qunitroot
returns the quantiles of the
asymptotic or finite sample distribution of the unit root test
statistics, given the probabilities.
The function punitroot
and qunitroot
use Fortran
routines and the response surface approach from J.G. MacKinnon (1988).
Many thanks to J.G. MacKinnon putting his code and tables under the
GPL license, which made this implementation possible.
J.G. MacKinnon for the underlying Fortran routine and the tables,
Diethelm Wuertz for the formerly Rmetrics R-port and Bernhard Pfaff
for the porting to urca.
Dickey, D.A., Fuller, W.A. (1979); Distribution of the estimators for autoregressive time series with a unit root, Journal of the American Statistical Association 74, 427–431.
MacKinnon, J.G. (1996); Numerical distribution functions for unit root and cointegration tests, Journal of Applied Econometrics 11, 601–618.
Phillips, P.C.B., Perron, P. (1988); Testing for a unit root in time series regression, Biometrika 75, 335–346.
## qunitroot - # Asymptotic quantile of t-statistic qunitroot(0.95, trend = "nc", statistic = "t") ## qunitroot - # Finite sample quantile of n-statistic qunitroot(0.95, N = 100, trend = "nc", statistic = "n") ## punitroot - # Asymptotic cumulative probability of t-statistic punitroot(1.2836, trend = "nc", statistic = "t") ## punitroot - # Finite sample cumulative probability of n-statistic punitroot(1.2836, N = 100, trend = "nc", statistic = "n") ## Mac Kinnon's unitrootTable - unitrootTable(trend = "nc")
## qunitroot - # Asymptotic quantile of t-statistic qunitroot(0.95, trend = "nc", statistic = "t") ## qunitroot - # Finite sample quantile of n-statistic qunitroot(0.95, N = 100, trend = "nc", statistic = "n") ## punitroot - # Asymptotic cumulative probability of t-statistic punitroot(1.2836, trend = "nc", statistic = "t") ## punitroot - # Finite sample cumulative probability of n-statistic punitroot(1.2836, N = 100, trend = "nc", statistic = "n") ## Mac Kinnon's unitrootTable - unitrootTable(trend = "nc")
This data set contains the fourteen U.S. economic time series used by Schotman and Dijk. All series are transformed by taking logarithms except for the bond yield. The sample period ends in 1988.
data(npext)
data(npext)
A data frame containing fourteen series.
year |
Time index from 1860 until 1988. |
realgnp |
Real GNP, [Billions of 1958 Dollars], |
[1909 -- 1988] | |
nomgnp |
Nominal GNP, |
[Millions of Current Dollars], [1909 -- 1988] | |
gnpperca |
Real Per Capita GNP, |
[1958 Dollars], [1909 -- 1988] | |
indprod |
Industrial Production Index, |
[1967 = 100], [1860 -- 1988] | |
employmt |
Total Employment, |
[Thousands], [1890 -- 1988] | |
unemploy |
Total Unemployment Rate, |
[Percent], [1890 -- 1988] | |
gnpdefl |
GNP Deflator, |
[1958 = 100], [1889 -- 1988] | |
cpi |
Consumer Price Index, |
[1967 = 100], [1860 -- 1988] | |
wages |
Nominal Wages |
(Average annual earnings per full-time employee in manufacturing), | |
[current Dollars], [1900 -- 1988] | |
realwag |
Real Wages, |
[Nominal wages/CPI], [1900 -- 1988] | |
M |
Money Stock (M2), |
[Billions of Dollars, annual averages], [1889 -- 1988] | |
velocity |
Velocity of Money, |
[1869 -- 1988] | |
interest |
Bond Yield (Basic Yields of 30-year corporate bonds), |
[Percent per annum], [1900 -- 1988] | |
sp500 |
Stock Prices, |
[Index; 1941 -- 43 = 100], [1871 -- 1988] | |
Bernhard Pfaff
Schotman, P.C. and van Dijk, H.K. (1991), On Bayesian Routes to Unit Roots, Journal of Applied Econometrics, 6, 387–401.
Koop, G. and Steel, M.F.J. (1994), A Decision-Theoretic Analysis of the Unit-Root Hypothesis using Mixtures of Elliptical Models, Journal of Business and Economic Statistics, 12, 95–107.
This data set contains the fourteen U.S. economic time series used by Nelson and Plosser in their seminal paper.
data(nporg)
data(nporg)
A data frame containing fourteen series.
year |
Time index from 1860 until 1970. |
gnp.r |
Real GNP, |
[Billions of 1958 Dollars], [1909 -- 1970] | |
gnp.n |
Nominal GNP, |
[Millions of Current Dollars], [1909 -- 1970] | |
gnp.pc |
Real Per Capita GNP, |
[1958 Dollars], [1909 -- 1970] | |
ip |
Industrial Production Index, |
[1967 = 100], [1860 -- 1970] | |
emp |
Total Employment, |
[Thousands], [1890 -- 1970] | |
ur |
Total Unemployment Rate, |
[Percent], [1890 -- 1970] | |
gnp.p |
GNP Deflator, |
[1958 = 100], [1889 -- 1970] | |
cpi |
Consumer Price Index, |
[1967 = 100], [1860 -- 1970] | |
wg.n |
Nominal Wages |
(Average annual earnings per full-time employee in manufacturing), | |
[current Dollars], [1900 -- 1970] | |
wg.r |
Real Wages, |
[Nominal wages/CPI], [1900 -- 1970] | |
M |
Money Stock (M2), |
[Billions of Dollars, annual averages], [1889 -- 1970] | |
vel |
Velocity of Money, |
[1869 -- 1970] | |
bnd |
Bond Yield (Basic Yields of 30-year corporate bonds), |
[Percent per annum], [1900 -- 1970] | |
sp |
Stock Prices, |
[Index; 1941 -- 43 = 100], [1871 -- 1970] | |
Bernhard Pfaff
Nelson, C.R. and Plosser, C.I. (1982), Trends and Random Walks in Macroeconomic Time Series, Journal of Monetary Economics, 10, 139–162.
http://korora.econ.yale.edu/phillips/index.htm
Plot methods for objects belonging to classes set in package
urca
. Depending on the unit root/cointegration test a
suitable graphical presentation is selected.
Diagram of fit of the Elliott,
Rothenberg and Stock unit root test of type "DF-GLS"
with
residual plot and their acfs' and pacfs'.
Residual plot and their acfs' and pacfs' of the KPSS test.
Time series plots and associated cointegration relations for the Johansen procedure.
Residual plot and their acfs' and pacfs' of the cointegration regression(s) for the Phillips and Ouliaris test.
Diagram of fit of the Phillips and Perron unit root test, residual plot and their acfs' and pacfs'.
Diagram of fit of the Schmidt and Phillips unit root test, residual plot and their acfs' and pacfs'.
Plot of recursive t-statistics as outcome of Zivot and Andrews unit root test.
Bernhard Pfaff
ur.ers-class
, ur.kpss-class
,
ca.jo-class
, ca.po-class
,
ur.pp-class
, ur.sp-class
and
ur.za-class
.
data(nporg) gnp <- na.omit(nporg[, "gnp.r"]) gnp.l <- log(gnp) # ers.gnp <- ur.ers(gnp, type="DF-GLS", model="trend", lag.max=4) plot(ers.gnp) # kpss.gnp <- ur.kpss(gnp.l, type="tau", lags="short") plot(kpss.gnp) # pp.gnp <- ur.pp(gnp, type="Z-tau", model="trend", lags="short") plot(pp.gnp) # sp.gnp <- ur.sp(gnp, type="tau", pol.deg=1, signif=0.01) plot(sp.gnp) # za.gnp <- ur.za(gnp, model="both", lag=2) plot(za.gnp) # data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm <- ca.jo(sjd, ecdet="const", type="eigen", K=2, season=4) plot(sjd.vecm)
data(nporg) gnp <- na.omit(nporg[, "gnp.r"]) gnp.l <- log(gnp) # ers.gnp <- ur.ers(gnp, type="DF-GLS", model="trend", lag.max=4) plot(ers.gnp) # kpss.gnp <- ur.kpss(gnp.l, type="tau", lags="short") plot(kpss.gnp) # pp.gnp <- ur.pp(gnp, type="Z-tau", model="trend", lags="short") plot(pp.gnp) # sp.gnp <- ur.sp(gnp, type="tau", pol.deg=1, signif=0.01) plot(sp.gnp) # za.gnp <- ur.za(gnp, model="both", lag=2) plot(za.gnp) # data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm <- ca.jo(sjd, ecdet="const", type="eigen", K=2, season=4) plot(sjd.vecm)
The function plotres
should be used for graphical inspection
of the VAR residuals, i.e. the estimated specification as
elaborated in the ‘Details’ section of ca.jo
. It displays the
residuals for each equation within a VAR and their acf's and pacf's.
plotres(x)
plotres(x)
x |
Object of class ‘ca.jo’. |
Bernhard Pfaff
Johansen, S. and Juselius, K. (1990), Maximum Likelihood Estimation and Inference on Cointegration – with Applications to the Demand for Money, Oxford Bulletin of Economics and Statistics, 52, 2, 169–210.
ca.jo
and ca.jo-class
.
data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm <- ca.jo(sjd, ecdet="const", type="eigen", K=2, spec="longrun", season=4) plotres(sjd.vecm)
data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm <- ca.jo(sjd, ecdet="const", type="eigen", K=2, spec="longrun", season=4) plotres(sjd.vecm)
This data set contains the time series used by David A. Dickey, Dennis W. Jansen and Daniel L. Thornton in their article: “A Primer on Cointegrating with an Application to Money and Income”.
data(Raotbl1)
data(Raotbl1)
A data frame with quarterly oberservations (ts objects) starting in 1953:1 until 1988:4 for the following 4 variables (all transformed to natural logarithms.
k |
Ratio of currency to total checkable deposits. |
ksa |
seasonally adjusted series of k . |
r3m |
Nominal 3 month T-Bill rate. |
r10y |
Nominal yield on 10-year Government securities. |
rgnp |
Real GNP. |
Bernhard Pfaff
Dickey, David A., Dennis W. Jansen and Daniel L. Thornton (1994), A Primer on Cointegration with an Application to Money and Income, in: Cointegration for the Applied Economist, ed. B. Bhaskara Rao, chapter 2, Data Appendix, Table D.1.
This data set contains the time series used by David A. Dickey, Dennis W. Jansen and Daniel L. Thornton in their article: “A Primer on Cointegrating with an Application to Money and Income”.
data(Raotbl2)
data(Raotbl2)
A data frame with quarterly oberservations (ts objects) starting in 1953:1 until 1988:4 for the following 4 variables (all transformed to natural logarithms.
m1p |
Real money balances M1. |
m2p |
Real money balances M2. |
mbp |
Real adjusted monetary base. |
nm1m2p |
Real non-M1 component of M2. |
Bernhard Pfaff
Dickey, David A., Dennis W. Jansen and Daniel L. Thornton (1994), A Primer on Cointegration with an Application to Money and Income, in: Cointegration for the Applied Economist, ed. B. Bhaskara Rao, chapter 2, Data Appendix, Table D.2.
This data set contains the time series used by Darryl Holden and Roger Perman in their article: “Unit Roots and Cointegration for the Economist".
data(Raotbl3)
data(Raotbl3)
A data frame with quarterly data (ts objects) from the United Kingdom starting in 1966:4 until 1991:2 for the following 6 variables (all transformed to natural logarithms).
lc |
Real consumption expenditure. |
li |
Real income. |
lw |
Real wealth. |
dd682 |
Dummy variable for 68:2. |
dd792 |
Dummy variable for 79:2. |
dd883 |
Dummy variable for 88:3. |
More details about the data are provided in the data appendix of Rao, “Cointegration for the Applied Economist" (see source below).
Bernhard Pfaff
Holden, Darryl and Roger Perman (1994), Unit Roots and Cointegration for the Economist, in: Cointegration for the Applied Economist, ed. B. Bhaskara Rao, chapter 3, Data Appendix, Table D.3.
This data set contains the time series used by Pierre Perron in his article: “Trend, Unit Root and Structural Change in Macroeconomic Time Series".
data(Raotbl4)
data(Raotbl4)
A data frame on real aggregate output for various countries; annual data starting in 1870 until 1986.
aus |
Australia. |
can |
Canada. |
den |
Denmark. |
fin |
Finland. |
fra |
France. |
ger |
Germany. |
For further details about the data see Notes in the data appendix ‘Table D.5’ of Rao, “Cointegration for the Applied Economist".
Bernhard Pfaff
Pierre Perron (1994), Trend, Unit Root and Structural Change in Macroeconomic Time Series, in: Cointegration for the Applied Economist, ed. B. Bhaskara Rao, chapter 4, Data Appendix, Table D.4.
This data set contains the time series used by Pierre Perron in his article: ”Trend, Unit Root and Structural Change in Macroeconomic Time Series".
data(Raotbl5)
data(Raotbl5)
A data frame on real aggregate output for various countries; annual data starting in 1870 until 1986.
ita |
Italy. |
nor |
Norway. |
swe |
Sweden. |
ukg |
United Kingdom. |
usa |
United States of America. |
For further details about the data see Notes in the data appendix ‘Table D.5’ of Rao, “Cointegration for the Applied Economist".
Bernhard Pfaff
Pierre Perron (1994), Trend, Unit Root and Structural Change in Macroeconomic Time Series, in: Cointegration for the Applied Economist, ed. B. Bhaskara Rao, chapter 4, Data Appendix, Table D.5.
This data set contains quarterly data for the U.S.A. in Yash P. Mehra's article: “Wage Growth and the Inflation Process: An Empirical Approach" for his wage-price equations.
data(Raotbl6)
data(Raotbl6)
A data frame with quarterly data from 1959:1 until 1989:3.
rgnp |
Real GNP. |
pgnp |
Potential real GNP. |
ulc |
Unit labor cost. |
gdfco |
Fixed weight deflator for personal consumption expenditure excluding food and energy. |
gdf |
Fixed weight GNP deflator. |
gdfim |
Fixed weight import deflator. |
gdfcf |
Fixed weight deflator for food in personal consumption expenditure. |
gdfce |
Fixed weight deflator for energy in personal consumption expenditure. |
Further details about the data can be found in the data appendix of Rao, “Cointegration for the Applied Economist".
Bernhard Pfaff
Yash P. Mehra (1994), Wage Growth and the Inflation Process: An Empirical Approach, in: Cointegration for the Applied Economist, ed. B. Bhaskara Rao, chapter 5, Data Appendix, Table D.6.
This data set contains Canadian quarterly data used by Glenn Otto in his article: “Diagnostic Testing: An Application to the Demand for M1".
data(Raotbl7)
data(Raotbl7)
A data frame with quarterly data from 1956:1 until 1988:4.
m1 |
Money stock M1. |
p |
Implicit price deflator for GDP, 1981=100. |
gdp |
GDP at constant 1981 prices. |
r |
90-day prime corporate rate. |
Bernhard Pfaff
Glenn Otto (1994), Diagnostic Testing: An Application to the Demand for M1, in: Cointegration for the Applied Economist, ed. B. Bhaskara Rao, chapter 6, Data Appendix, Table D.6.
Displays the outcome of the unit root/cointegration tests.
Displays the test statistic of the Johansen procedure.
Displays the test statistic of a restricted
VAR with respect to and/or
.
Displays the test statistic of the Phillips and Ouliaris cointegration test.
Displays the test statistic of the Augmented, Dickey and Fuller unit root test.
Displays the test statistic of the Elliott, Rothenberg and Stock unit root test.
Displays the test statistic of the Kwiatkowski et al. unit root test.
Displays the test statistic of the Phillips and Perron unit root test.
Displays the test statistic of the augmented Dickey-Fuller unit root test.
Displays the test statistic of the Schmidt and Phillips unit root test.
Displays the test statistic of the Zivot and Andrews unit root test.
Displays the summary output.
Bernhard Pfaff
ca.jo-class
, cajo.test-class
,
ca.po-class
, ur.ers-class
,
ur.kpss-class
, ur.pp-class
,
ur.sp-class
, ur.df-class
and ur.za-class
.
data(nporg) gnp <- na.omit(nporg[, "gnp.r"]) gnp.l <- log(gnp) # ers.gnp <- ur.ers(gnp, type="DF-GLS", model="trend", lag.max=4) show(ers.gnp) # kpss.gnp <- ur.kpss(gnp.l, type="tau", lags="short") show(kpss.gnp) # pp.gnp <- ur.pp(gnp, type="Z-tau", model="trend", lags="short") show(pp.gnp) # df.gnp <- ur.df(gnp, type="trend", lags=4) show(df.gnp) # sp.gnp <- ur.sp(gnp, type="tau", pol.deg=1, signif=0.01) show(sp.gnp) # za.gnp <- ur.za(gnp, model="both", lag=2) show(za.gnp) # data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, season=4) show(sjd.vecm) # HD0 <- matrix(c(-1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1), c(5,4)) show(blrtest(sjd.vecm, H=HD0, r=1))
data(nporg) gnp <- na.omit(nporg[, "gnp.r"]) gnp.l <- log(gnp) # ers.gnp <- ur.ers(gnp, type="DF-GLS", model="trend", lag.max=4) show(ers.gnp) # kpss.gnp <- ur.kpss(gnp.l, type="tau", lags="short") show(kpss.gnp) # pp.gnp <- ur.pp(gnp, type="Z-tau", model="trend", lags="short") show(pp.gnp) # df.gnp <- ur.df(gnp, type="trend", lags=4) show(df.gnp) # sp.gnp <- ur.sp(gnp, type="tau", pol.deg=1, signif=0.01) show(sp.gnp) # za.gnp <- ur.za(gnp, model="both", lag=2) show(za.gnp) # data(denmark) sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] sjd.vecm <- ca.jo(sjd, ecdet = "const", type="eigen", K=2, season=4) show(sjd.vecm) # HD0 <- matrix(c(-1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1), c(5,4)) show(blrtest(sjd.vecm, H=HD0, r=1))
The function show.urca
is called within the defined methods
for classes ca.jo
, cajo.test
, ca.po
,
ur.df
, ur.ers
, ur.kpss
, ur.po
, ur.pp
,
ur.df
, ur.sp
and ur.za
.
show.urca(object)
show.urca(object)
object |
Object of class contained in |
This function is called by method show
.
The Name and test statistic of a unit root/cointegration test.
Bernhard Pfaff
Summarises the outcome of unit root/cointegration tests by creating a new object of class sumurca
.
The test type, its statistic, the test regression and the critical values for the Augmented Dickey and Fuller test are returned.
The test type, its statistic and the
critical values for the Elliott, Rothenberg and Stock test are
returned. In case of test "DF-GLS"
the summary output
of the test regression is provided, too.
The test statistic, the critical value as well as the test type and the number of lags used for error correction for the Kwiatkowski et al. unit root test is returned.
The "trace"
or "eigen"
statistic,
the critical values as well as the eigenvalues, eigenvectors and
the loading matrix of the Johansen procedure are reported.
The test statistic of a restricted VAR
with respect to and/or
with
p-value and degrees of freedom is reported. Furthermore, the
restriction matrix(ces), the eigenvalues and eigenvectors as well
as the loading matrix are returned.
The "Pz"
or "Pu"
statistic,
the critical values as well as the summary output of the test
regression for the Phillips and Ouliaris cointegration test.
The Z statistic, the critical values as well as the summary output of the test regression for the Phillips and Perron test, as well as the test statistics for the coefficients of the deterministic part is returned.
The relevant tau statistic, the critical values as well as the summary output of the test regression for the augmented Dickey-Fuller test is returned.
The test statistic, the critical value as well as the summary output of the test regression for the Schmidt and Phillips test is returned.
The test statistic, the critical values as well as the summary output of the test regression for the Zivot and Andrews test is returned.
Bernhard Pfaff
ur.ers-class
, ur.kpss-class
,
ca.jo-class
, cajo.test-class
,
ca.po-class
, ur.pp-class
,
ur.df-class
, ur.sp-class
,
ur.za-class
and sumurca-class
.
data(nporg) gnp <- na.omit(nporg[, "gnp.r"]) gnp.l <- log(gnp) # ers.gnp <- ur.ers(gnp, type="DF-GLS", model="trend", lag.max=4) summary(ers.gnp) # kpss.gnp <- ur.kpss(gnp.l, type="tau", lags="short") summary(kpss.gnp) # pp.gnp <- ur.pp(gnp, type="Z-tau", model="trend", lags="short") summary(pp.gnp) # df.gnp <- ur.df(gnp, type="trend", lags=4) summary(df.gnp) # sp.gnp <- ur.sp(gnp, type="tau", pol.deg=1, signif=0.01) summary(sp.gnp) # za.gnp <- ur.za(gnp, model="both", lag=2) summary(za.gnp) # data(finland) sjf <- finland sjf.vecm <- ca.jo(sjf, ecdet="none", type="eigen", K=2, season=4) summary(sjf.vecm) # HF0 <- matrix(c(-1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), c(4,3)) summary(blrtest(sjf.vecm, H=HF0, r=3))
data(nporg) gnp <- na.omit(nporg[, "gnp.r"]) gnp.l <- log(gnp) # ers.gnp <- ur.ers(gnp, type="DF-GLS", model="trend", lag.max=4) summary(ers.gnp) # kpss.gnp <- ur.kpss(gnp.l, type="tau", lags="short") summary(kpss.gnp) # pp.gnp <- ur.pp(gnp, type="Z-tau", model="trend", lags="short") summary(pp.gnp) # df.gnp <- ur.df(gnp, type="trend", lags=4) summary(df.gnp) # sp.gnp <- ur.sp(gnp, type="tau", pol.deg=1, signif=0.01) summary(sp.gnp) # za.gnp <- ur.za(gnp, model="both", lag=2) summary(za.gnp) # data(finland) sjf <- finland sjf.vecm <- ca.jo(sjf, ecdet="none", type="eigen", K=2, season=4) summary(sjf.vecm) # HF0 <- matrix(c(-1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), c(4,3)) summary(blrtest(sjf.vecm, H=HF0, r=3))
A class for objects returned by applying method summary() to objects
from classes: ur.ers
, ca.jo
, cajo.test
,
ur.kpss
, ca.po
, ur.pp
, ur.df
, ur.sp
or ur.za
.
classname
:The class name of the original object to which method summary is applied.
test.name
:The name of the test, i.e. ‘Johansen-Procedure’.
testreg
:The test regression where applicable,
otherwise set to NULL
.
teststat
:The test statististic where applicable,
otherwise set to NULL
.
cval
:The critical values of the test where applicable,
otherwise set to NULL
.
bpoint
:Potential break point where applicable,
otherwise set to NULL
.
signif
:Significance level of the test where
applicable, otherwise set to NULL
.
model
:Description of the underlying model where applicable,
otherwise set to NULL
.
type
:The test type where applicable,
otherwise set to NULL
.
auxstat
:The result of an auxiliary regression where
applicable, otherwise set to NULL
.
lag
:The number of lags included where applicable,
otherwise set to NULL
.
H
:The matrix containing the restrictions placed upon
where applicable, otherwise set to
NULL
.
A
:The matrix containing the restrictions placed upon
where applicable, otherwise set to
NULL
.
lambda
:The eigenvalues where applicable,
otherwise set to NULL
.
pval
:The p-value and the degrees of freedom where
applicable, otherwise set to NULL
.
V
:The matrix of eigenvectors, normalised with respect
to the first variable where applicable,
otherwise set to NULL
.
W
:The matrix of loading weights where applicable,
otherwise set to NULL
.
P
:The count of variables where applicable,
otherwise set to NULL
.
For this class a print
method is available, that nicely prints the
summary results of objects belonging to either one of the following
classes: ur.ers
, ca.jo
, cajo.test
,
ur.kpss
, ca.po
, ur.pp
, ur.df
, ur.sp
or
ur.za
.
Bernhard Pfaff
summary
, ur.ers-class
,
ur.kpss-class
, ca.jo-class
,
cajo.test-class
, ca.po-class
,
ur.pp-class
, ur.df-class
,
ur.sp-class
and ur.za-class
.
This data set contains the series used by Hylleberg, S., R. F. Engle, C. W. J. Granger and B. S. Yoo (1990), Seasonal Integration and Cointegration, Journal of econometrics, 44, 215–238.
data(UKconinc)
data(UKconinc)
A data frame of quarterly data ranging from 1955:Q1 until 1984:Q4. The data is expressed in natural logarithms.
consl |
The log of total real consumption in the U.K. |
incl |
The log of real disposable income in the U.K. |
Bernhard Pfaff
Journal of Applied Econometrics Data Archive http://qed.econ.queensu.ca/jae/
Hylleberg, S., R. F. Engle, C. W. J. Granger and B. S. Yoo (1990), Seasonal Integration and Cointegration, Journal of econometrics, 44, 215–238.
This data set contains the series used by in Charemza, W. (1997), New Directions in Econometric Practice, 2nd edition, Edward Elgar, Cheltenha, Uk. for analysing private in the United Kingdom.
data(UKconsumption)
data(UKconsumption)
A data frame of quarterly ts
objects ranging from 1957:Q1
until 1975:Q4.
cons |
Consumers` non-durable expenditure in the U.K. in 1970 prices. |
inc |
Personal disposable income in the U.K. in 1970 prices. |
price |
Consumers` expenditure deflator index, 1970=100. |
Bernhard Pfaff
Pokorny, M. (1987), An Introduction to Econometrics, page 408, Basil Blackwell Ltd. Original data source: Economic Trends, Annual Supplements, 1976 and 1981, HMSO.
Charemza, W. (1997), New Directions in Econometrics Practice, 2nd edition, Edward Elgar, Cheltenham, U.K.
This data set contains the series used by in Johansen and Juselius (1992), Testing structural hypothesis in a multivariate cointegration analysis of the PPP and UIP for UK, Journal of Econometrics, 53, 211-244.
data(UKpppuip)
data(UKpppuip)
A data frame of quarterly data ranging from 1971:Q1 until 1987:Q2. All variables are expressed in logarithms.
p1 |
UK wholesale price index. |
p2 |
Trade weighted foreign whole sale price index. |
e12 |
UK effective exchange rate. |
i1 |
Three-month treasury bill rate in the UK. |
i2 |
Three-month Eurodollar interest rate. |
dpoil0 |
World oil price at period t . |
dpoil1 |
World oil price at period t-1 .
|
Bernhard Pfaff
Johansen, S. and K. Juselius (1992), Testing structural hypothesis in a multivariate cointegration analysis of the PPP and UIP for UK, Journal of Econometrics, 53, 211-244.
Performs the augmented Dickey-Fuller unit root test.
ur.df(y, type = c("none", "drift", "trend"), lags = 1, selectlags = c("Fixed", "AIC", "BIC"))
ur.df(y, type = c("none", "drift", "trend"), lags = 1, selectlags = c("Fixed", "AIC", "BIC"))
y |
Vector to be tested for a unit root. |
type |
Test type, either |
lags |
Number of lags for endogenous variable to be included. |
selectlags |
Lag selection can be achieved according to the
Akaike |
The function ur.df()
computes the augmented Dickey-Fuller
test. If type is set to "none"
neither an intercept nor a trend
is included in the test regression. If it is set to "drift"
an
intercept is added and if it is set to "trend"
both an intercept
and a trend is added. The critical values are taken from Hamilton
(1994) and Dickey and Fuller(1981).
An object of class ur.df
.
Bernhard Pfaff
Dickey, D. A. and Fuller, W. A. (1979), Distributions of the Estimators For Autoregressive Time Series with a Unit Root, Journal of the American Statistical Association, 75, 427–431.
Dickey, D. A. and Fuller, W. A. (1981), Likelihood Ratio Statistics for Autoregressive Time Series with a Unit Root, Econometrica, 49, 1057–1072.
Hamilton (1994), Time Series Analysis, Princeton University Press.
data(Raotbl3) attach(Raotbl3) lc.df <- ur.df(y=lc, lags=3, type='trend') summary(lc.df)
data(Raotbl3) attach(Raotbl3) lc.df <- ur.df(y=lc, lags=3, type='trend') summary(lc.df)
This class contains the relevant information by applying the augmented Dickey-Fuller unit root test to a time series.
y
:Object of class "vector"
: The time series to
be tested.
model
:Object of class "character"
: The type of
the deterministic part, either "none"
, "drift"
or
"trend"
. The latter includes a constant term, too.
lags
:Object of class "integer"
: Number of lags
for error correction.
cval
:Object of class "matrix"
: Critical values
at the 1%, 5% and 10% level of significance.
teststat
:Object of class "matrix"
: Value of
the test statistic.
testreg
:Object of class "ANY"
: The summary
output of the test regression.
res
:Object of class "vector"
: The residuals of
the test regression.
test.name
:Object of class "character"
: The
name of the test, i.e ‘Augmented-Dickey-Fuller Test’.
Class urca
, directly.
Type showMethods(classes="ur.df")
at the R prompt for a
complete list of methods which are available for this class.
Useful methods include
show
:test statistic.
summary
:like show, but critical value and summary of test regression added.
plot
:Residual plot, acfs' and pacfs'.
Bernhard Pfaff
Dickey, D. A. and Fuller, W. A. (1979), Distributions of the Estimators For Autoregressive Time Series with a Unit Root, Journal of the American Statistical Association, 75, 427–431.
Dickey, D. A. and Fuller, W. A. (1981), Likelihood Ratio Statistics for Autoregressive Time Series with a Unit Root, Econometrica, 49, 1057–1072.
Hamilton (1994), Time Series Analysis, Princeton University Press.
ur.df
and urca-class
Performs the Elliott, Rothenberg and Stock unit root test.
ur.ers(y, type = c("DF-GLS", "P-test"), model = c("constant", "trend"), lag.max = 4)
ur.ers(y, type = c("DF-GLS", "P-test"), model = c("constant", "trend"), lag.max = 4)
y |
Vector to be tested for a unit root. |
type |
Test type, either |
model |
The deterministic model used for detrending. |
lag.max |
The maximum numbers of lags used for testing of a
decent lag truncation for the |
To improve the power of the unit root test, Elliot, Rothenberg and Stock
proposed a local to unity detrending of the time series. ERS developed
a feasible point optimal test, "P-test"
, which takes serial
correlation of the error term into account. The second test type is
the "DF-GLS"
test, which is an ADF-type test applied to the
detrended data without intercept. Critical values for this test are
taken from MacKinnon in case of model="constant"
and else from
Table 1 of Elliot, Rothenberg and Stock.
An object of class ur.ers
.
Bernhard Pfaff
Elliott, G., Rothenberg, T.J. and Stock, J.H. (1996), Efficient Tests for an Autoregressive Unit Root, Econometrica, Vol. 64, No. 4, 813–836.
MacKinnon, J.G. (1991), Critical Values for Cointegration Tests, Long-Run Economic Relationships, eds. R.F. Engle and C.W.J. Granger, London, Oxford, 267–276.
data(nporg) gnp <- na.omit(nporg[, "gnp.r"]) ers.gnp <- ur.ers(gnp, type="DF-GLS", model="const", lag.max=4) summary(ers.gnp)
data(nporg) gnp <- na.omit(nporg[, "gnp.r"]) ers.gnp <- ur.ers(gnp, type="DF-GLS", model="const", lag.max=4) summary(ers.gnp)
This class contains the relevant information by applying the Elliott, Rothenberg and Stock unit root test.
y
:Object of class "vector"
: The time series to
be tested.
yd
:Object of class "vector"
: The detrended
time series.
type
:Object of class "character"
: Test type,
either "DF-GLS"
(default), or "P-test"
.
model
:Object of class "character"
: The
deterministic model used for detrending, either intercept only, or
intercept with linear trend.
lag
:Object of class "integer"
: The number of
lags used in the test/auxiliary regression.
cval
:Object of class "matrix"
: The critical
values of the test at the 1%, 5% and 10% level of significance.
teststat
:Object of class "numeric"
: The value
of the test statistic.
testreg
:Object of class "ANY"
: The test
regression, only set for "DF-GLS"
.
test.name
:Object of class "character"
: The
name of the test, i.e. ‘Elliott, Rothenberg and Stock’.
Class urca
, directly.
Type showMethods(classes="ur.ers")
at the R prompt for a
complete list of methods which are available for this class.
Useful methods include
show
:test statistic.
summary
:like show, but test type, test regression (type="DF-GLS"
) and critical values added.
plot
:Diagram of fit, residual plot and their acfs'
and pacfs' for type="DF-GLS"
.
Bernhard Pfaff
Elliott, G., Rothenberg, T.J. and Stock, J.H. (1996), Efficient Tests for an Autoregressive Unit Root, Econometrica, Vol. 64, No. 4, 813–836.
MacKinnon, J.G. (1991), Critical Values for Cointegration Tests, Long-Run Economic Relationships, eds. R.F. Engle and C.W.J. Granger, London, Oxford, 267–276.
ur.ers
and urca-class
.
Performs the KPSS unit root test, where the Null hypothesis is
stationarity. The test types specify as deterministic component either
a constant "mu"
or a constant with linear trend "tau"
.
ur.kpss(y, type = c("mu", "tau"), lags = c("short", "long", "nil"), use.lag = NULL)
ur.kpss(y, type = c("mu", "tau"), lags = c("short", "long", "nil"), use.lag = NULL)
y |
Vector to be tested for a unit root. |
type |
Type of deterministic part. |
lags |
Maximum number of lags used for error term correction. |
use.lag |
User specified number of lags. |
lags="short"
sets the number of lags to
, whereas
lags="long"
sets the number of lags to
. If
lags="nil"
is choosen,
then no error correction is made. Furthermore, one can specify a
different number of maximum lags by setting use.lag
accordingly.
An object of class ur.kpss
.
Bernhard Pfaff
Kwiatkowski, D., Phillips, P.C.B., Schmidt, P. and Shin, Y., (1992), Testing the Null Hypothesis of Stationarity Against the Alternative of a Unit Root: How Sure Are We That Economic Time Series Have a Unit Root?, Journal of Econometrics, 54, 159–178.
Download possible at: https://cowles.yale.edu/, see rubric 'Discussion Papers (CFDPs)'.
data(nporg) gnp <- na.omit(nporg[, "gnp.r"]) gnp.l <- log(gnp) kpss.gnp <- ur.kpss(gnp.l, type="tau", lags="short") summary(kpss.gnp)
data(nporg) gnp <- na.omit(nporg[, "gnp.r"]) gnp.l <- log(gnp) kpss.gnp <- ur.kpss(gnp.l, type="tau", lags="short") summary(kpss.gnp)
This class contains the relevant information by applying the Kwiatkowski, Phillips, Schmidt and Shin unit root test to a time series.
y
:Object of class "vector"
: The time series to
be tested.
type
:Object of class "character"
: Test type,
"mu"
or "tau"
depending on the deterministic part.
lag
:Object of class "integer"
: Number of lags
for error term correction.
cval
:Object of class "matrix"
: Critical value
of test.
teststat
:Object of class "numeric"
: Value of
test statistic.
res
:Object of class "vector"
: Residuals of
test regression.
test.name
:Object of class "character"
: The
name of the test, i.e. ‘KPSS’.
Class urca
, directly.
Type showMethods(classes="ur.kpss")
at the R prompt for a
complete list of methods which are available for this class.
Useful methods include
show
:test statistic.
summary
:like show, but critical values, lags and test type added.
plot
:Residual plot and their acfs' and pacfs'.
Bernhard Pfaff
Kwiatkowski, D., Phillips, P.C.B., Schmidt, P. and Shin, Y., (1992), Testing the Null Hypothesis of Stationarity Against the Alternative of a Unit Root: How Sure Are We That Economic Time Series Have a Unit Root?, Journal of Econometrics, 54, 159–178.
Download possible at: https://cowles.yale.edu/, see rubric 'Discussion Papers (CFDPs)'.
ur.kpss
and urca-class
.
Performs the Phillips and Perron unit root test. Beside the Z statistics Z-alpha and Z-tau, the Z statistics for the deterministic part of the test regression are computed, too.
ur.pp(x, type = c("Z-alpha", "Z-tau"), model = c("constant", "trend"), lags = c("short", "long"), use.lag = NULL)
ur.pp(x, type = c("Z-alpha", "Z-tau"), model = c("constant", "trend"), lags = c("short", "long"), use.lag = NULL)
x |
Vector to be tested for a unit root. |
type |
Test type, either |
model |
Determines the deterministic part in the test regression. |
lags |
Lags used for correction of error term. |
use.lag |
Use of a different lag number, specified by the user. |
The function ur.pp()
computes the Phillips and Perron test. For
correction of the error term a Bartlett window is used.
An object of class ur.pp
.
Bernhard Pfaff
Phillips, P.C.B. and Perron, P. (1988), Testing for a unit root in time series regression, Biometrika, 75(2), 335–346.
MacKinnon, J.G. (1991), Critical Values for Cointegration Tests, Long-Run Economic Relationships, eds. R.F. Engle and C.W.J. Granger, London, Oxford, 267–276.
Download possible at: https://cowles.yale.edu/, see rubric 'Discussion Papers (CFDPs)'.
data(nporg) gnp <- na.omit(nporg[, "gnp.r"]) pp.gnp <- ur.pp(gnp, type="Z-tau", model="trend", lags="short") summary(pp.gnp)
data(nporg) gnp <- na.omit(nporg[, "gnp.r"]) pp.gnp <- ur.pp(gnp, type="Z-tau", model="trend", lags="short") summary(pp.gnp)
This class contains the relevant information by applying the Phillips and Perron unit root test to a time series.
y
:Object of class "vector"
: The time series to
be tested.
type
:Object of class "character"
: Test type of
Z statistic, either "Z-alpha"
or "Z-tau"
.
model
:Object of class "character"
: The type of
the deterministic part, either "constant"
or
"trend"
. The latter includes a constant term, too.
lag
:Object of class "integer"
: Number of lags
for error correction.
cval
:Object of class "matrix"
: Critical values
at the 1%, 5% and 10% level of significance.
teststat
:Object of class "numeric"
: Value of
the test statistic.
testreg
:Object of class "ANY"
: The summary
output of the test regression.
auxstat
:Object of class "matrix"
: Test
statistic(s) of the deterministic part.
res
:Object of class "vector"
: The residuals of
the test regression.
test.name
:Object of class "character"
: The
name of the test, i.e ‘Phillips-Perron’.
Class urca
, directly.
Type showMethods(classes="ur.pp")
at the R prompt for a
complete list of methods which are available for this class.
Useful methods include
show
:test statistic.
summary
:like show, but critical value and summary of test regression added.
plot
:Diagram of fit plot, residual plot and their acfs' and pacfs'.
Bernhard Pfaff
Phillips, P.C.B. and Perron, P. (1988), Testing for a unit root in time series regression, Biometrika, 75(2), 335–346.
MacKinnon, J.G. (1991), Critical Values for Cointegration Tests, Long-Run Economic Relationships, eds. R.F. Engle and C.W.J. Granger, London, Oxford, 267–276.
Download possible at: https://cowles.yale.edu/, see rubric 'Discussion Papers (CFDPs)'.
ur.pp
and urca-class
Performs the Schmidt and Phillips unit root test, where under the Null and Alternative Hypothesis the coefficients of the deterministic variables are included.
ur.sp(y, type = c("tau", "rho"), pol.deg = c(1, 2, 3, 4), signif = c(0.01, 0.05, 0.1))
ur.sp(y, type = c("tau", "rho"), pol.deg = c(1, 2, 3, 4), signif = c(0.01, 0.05, 0.1))
y |
Vector to be tested for a unit root. |
type |
Test type, either |
pol.deg |
Degree of polynomial in the test regression. |
signif |
Significance level for the critical value of the test statistic. |
Under the Null and the Alternative hypothesis the coefficients of the
deterministic part of the test regression are included. Two test types
are available: the rho
-test and the tau
-test.
Both test are extracted from the LM principle.
An object of class "ur.sp"
.
Bernhard Pfaff
Schmidt, P. and Phillips, P.C.B. (1992), LM Test for a Unit Root in the Presence of Deterministic Trends, Oxford Bulletin of Economics and Statistics, 54(3), 257–287.
Download possible at: https://cowles.yale.edu/, see rubric 'Discussion Papers (CFDPs)'.
data(nporg) gnp <- na.omit(nporg[, "gnp.r"]) sp.gnp <- ur.sp(gnp, type="tau", pol.deg=1, signif=0.01) summary(sp.gnp)
data(nporg) gnp <- na.omit(nporg[, "gnp.r"]) sp.gnp <- ur.sp(gnp, type="tau", pol.deg=1, signif=0.01) summary(sp.gnp)
This class contains the relevant information by applying the Schmidt and Phillips unit root test to a time series.
y
:Object of class "vector"
: The time series to
be tested.
type
:Object of class "character"
: Test type,
"rho"
or "tau"
test statistic.
polynomial
:Object of class "integer"
:
Deterministic trend specification
signif
:Object of class "numeric"
: Critical values.
teststat
:Object of class "numeric"
: Value of
the test statistic.
cval
:Object of class "numeric"
: The critical
values, depending on "signif"
, "polynomial"
and the
sample size.
res
:Object of class "vector"
: The residuals of
the test regression.
testreg
:Object of class "ANY"
: The summary
output of the test regression.
test.name
:Object of class "character"
: The
name of the test, i.e. ‘"Schmidt and Phillips’.
Class urca
, directly.
Type showMethods(classes="ur.sp")
at the R prompt for a
complete list of methods which are available for this class.
Useful methods include
show
:test statistic.
summary
:like show, but critical value and summary of test regression added.
plot
:Diagram of fit plot, residual plot and their acfs' and pacfs'.
Bernhard Pfaff
Schmidt, P. and Phillips, P.C.B. (1992), LM Test for a Unit Root in the Presence of Deterministic Trends, Oxford Bulletin of Economics and Statistics, 54(3), 257–287.
Download possible at: https://cowles.yale.edu/, see rubric 'Discussion Papers (CFDPs)'.
ur.sp
and urca-class
.
Performs the Zivot and Andrews unit root test, which allows a break at an unknown point in either the intercept, the linear trend or in both.
ur.za(y, model = c("intercept", "trend", "both"), lag=NULL)
ur.za(y, model = c("intercept", "trend", "both"), lag=NULL)
y |
Vector to be tested for a unit root. |
model |
Specification if the potential break occured in either the intercept, the linear trend or in both. |
lag |
The highest number of lagged endogenous differenced variables to be included in the test regression |
This test is based upon the recursive estimation of a test regression. The test statistic is defined as the minimum t-statistic of the coeffcient of the lagged endogenous variable.
An object of class ur.za
.
Bernhard Pfaff
Zivot, E. and Andrews, Donald W.K. (1992), Further Evidence on the Great Crash, the Oil-Price Shock, and the Unit-Root Hypothesis, Journal of Business and Economic Statistics, 10(3), 251–270.
Download possible at: https://cowles.yale.edu/, see rubric 'Discussion Papers (CFDPs)'.
data(nporg) gnp <- na.omit(nporg[, "gnp.r"]) za.gnp <- ur.za(gnp, model="both", lag=2) summary(za.gnp)
data(nporg) gnp <- na.omit(nporg[, "gnp.r"]) za.gnp <- ur.za(gnp, model="both", lag=2) summary(za.gnp)
This class contains the relevant information by applying the Zivot and Andrews unit root test to a time series.
y
:Object of class "vector"
: The time series to
be tested.
model
:Object of class "character"
: The model
to be used, i.e. intercept, trend or both
lag
:Object of class "integer"
: The highest
number of lags to include in the test regression.
teststat
:Object of class "numeric"
: The t-statistic.
cval
:Object of class "vector"
: Critical values
at the 1%, 5% and 10% level of significance.
bpoint
:Object of class "integer"
: The
potential break point.
tstats
:Object of class "vector"
The
t-statistics of the rolling regression.
res
:Object of class "vector"
The residuals of
the test regression.
test.name
:Object of class "character"
The name
of the test, i.e. ‘Zivot and Andrews’.
testreg
:Object of class "ANY"
The summary
output of the test regression.
Class urca
, directly.
Type showMethods(classes="ur.za")
at the R prompt for a
complete list of methods which are available for this class.
Useful methods include
show
:test statistic and critical values.
summary
:like show, but summary of test regression added.
plot
:plot of recursive t-statistics.
Bernhard Pfaff
Zivot, E. and Andrews, Donald W.K. (1992), Further Evidence on the Great Crash, the Oil-Price Shock, and the Unit-Root Hypothesis, Journal of Business and Economic Statistics, 10(3), 251–270.
Download possible at: https://cowles.yale.edu/, see rubric 'Discussion Papers (CFDPs)'.
ur.za
and urca-class
.
This class is the parent class of the specific classes designed holding the test specific information of the unit root/cointegration tests.
Objects can be created by calls of the form new("urca", ...)
,
but most often the slot test.name
is set by calling one of the
unit root/cointegration functions, e.g ur.za
.
test.name
:Object of class "character"
. The
name of the unit root/cointegration test.
No methods defined with class ‘urca’.
Bernhard Pfaff
ur.ers-class
, ur.kpss-class
,
ca.jo-class
, ca.po-class
,
ur.pp-class
, ur.sp-class
and ur.za-class
.
This function is an internal function and is called by
ur.sp
. It computes the critical value of the Schmidt and
Phillips test, given a level of significance, the polynomial degree of
the test regression, the test type and the sample size.
.spcv(obs, type, pol.deg, signif)
.spcv(obs, type, pol.deg, signif)
obs |
The sample size. |
type |
The test type. |
pol.deg |
The polynomial degree. |
signif |
The significance level. |
The critical value of the test.
Bernhard Pfaff
Schmidt, P. and Phillips, P.C.B. (1992), LM Test for a Unit Root in the Presence of Deterministic Trends, Oxford Bulletin of Economics and Statistics, 54(3), 257–287.
Download possible at: https://cowles.yale.edu/, see rubric 'Discussion Papers (CFDPs)'.