R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("urca-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('urca') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "ablrtest" > > ### * ablrtest > > flush(stderr()); flush(stdout()) > > ### Name: ablrtest > ### Title: Likelihood ratio test for restrictions on alpha and beta > ### Aliases: ablrtest > ### Keywords: regression > > ### ** Examples > > data(denmark) > sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] > sjd.vecm <- ca.jo(sjd, constant=TRUE, 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)) ###################### # Johansen-Procedure # ###################### Estimation and testing under linear restrictions on alpha and beta The VECM has been estimated subject to: beta=H*phi and/or alpha=A*psi [,1] [,2] [,3] [1,] 1 0 0 [2,] -1 0 0 [3,] 0 1 0 [4,] 0 -1 0 [5,] 0 0 1 [,1] [,2] [,3] [1,] 1 0 0 [2,] 0 1 0 [3,] 0 0 0 [4,] 0 0 1 Eigenvalues of restricted VAR (lambda): [1] 0.4100 0.0090 0.0053 The value of the likelihood ratio test statistic: 2.13 distributed as chi square with 2 df. The p-value of the test statistic is: 0.35 Eigenvectors, normalised to first column of the restricted VAR: [,1] [1,] 1.0000 [2,] -1.0000 [3,] 5.9508 [4,] -5.9508 [5,] -6.2162 Weights W of the restricted VAR: [,1] [1,] -0.1519 [2,] 0.0992 [3,] 0.0000 [4,] 0.0288 > > > > cleanEx(); ..nameEx <- "alphaols" > > ### * alphaols > > flush(stderr()); flush(stdout()) > > ### Name: alphaols > ### Title: OLS regression of VECM weighting matrix > ### Aliases: alphaols > ### Keywords: regression > > ### ** Examples > > data(denmark) > sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] > sjd.vecm1 <- ca.jo(sjd, constant=TRUE, type="eigen", K=2, spec="longrun", + season=4) > summary(alphaols(sjd.vecm1)) Response Y1 : Call: lm(formula = Y1 ~ -1 + RKV) Residuals: Min 1Q Median 3Q Max -0.039482 -0.014437 -0.005498 0.013169 0.051973 Coefficients: Estimate Std. Error t value Pr(>|t|) RKV1 -2.130e-01 6.039e-02 -3.526 0.000938 *** RKV2 -4.815e-03 4.028e-02 -0.120 0.905341 RKV3 3.501e-02 2.184e-02 1.603 0.115453 RKV4 2.029e-03 2.815e-03 0.721 0.474633 RKV5 -1.251e-12 3.123e-02 -4.01e-11 1.000000 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.02001 on 48 degrees of freedom Multiple R-Squared: 0.2446, Adjusted R-squared: 0.1659 F-statistic: 3.108 on 5 and 48 DF, p-value: 0.01647 Response Y2 : Call: lm(formula = Y2 ~ -1 + RKV) Residuals: Min 1Q Median 3Q Max -0.034479 -0.015065 -0.001000 0.011147 0.056657 Coefficients: Estimate Std. Error t value Pr(>|t|) RKV1 1.150e-01 6.189e-02 1.859 0.0692 . RKV2 1.975e-02 4.128e-02 0.478 0.6345 RKV3 4.994e-02 2.238e-02 2.231 0.0304 * RKV4 1.109e-03 2.885e-03 0.384 0.7025 RKV5 1.832e-13 3.200e-02 5.72e-12 1.0000 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.0205 on 48 degrees of freedom Multiple R-Squared: 0.1551, Adjusted R-squared: 0.06707 F-statistic: 1.762 on 5 and 48 DF, p-value: 0.1387 Response Y3 : Call: lm(formula = Y3 ~ -1 + RKV) Residuals: Min 1Q Median 3Q Max -2.327e-02 -4.445e-03 -3.026e-05 4.853e-03 1.764e-02 Coefficients: Estimate Std. Error t value Pr(>|t|) RKV1 2.318e-02 2.403e-02 0.965 0.340 RKV2 -1.060e-02 1.602e-02 -0.661 0.512 RKV3 3.480e-03 8.688e-03 0.401 0.691 RKV4 -1.574e-03 1.120e-03 -1.405 0.166 RKV5 5.399e-14 1.242e-02 4.35e-12 1.000 Residual standard error: 0.00796 on 48 degrees of freedom Multiple R-Squared: 0.068, Adjusted R-squared: -0.02908 F-statistic: 0.7004 on 5 and 48 DF, p-value: 0.6258 Response Y4 : Call: lm(formula = Y4 ~ -1 + RKV) Residuals: Min 1Q Median 3Q Max -9.125e-03 -2.876e-03 -1.527e-05 2.458e-03 1.490e-02 Coefficients: Estimate Std. Error t value Pr(>|t|) RKV1 2.941e-02 1.524e-02 1.930 0.05949 . RKV2 -3.023e-02 1.016e-02 -2.975 0.00458 ** RKV3 -2.812e-03 5.510e-03 -0.510 0.61222 RKV4 -4.768e-05 7.104e-04 -0.067 0.94677 RKV5 9.114e-14 7.879e-03 1.16e-11 1.00000 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.005048 on 48 degrees of freedom Multiple R-Squared: 0.211, Adjusted R-squared: 0.1288 F-statistic: 2.568 on 5 and 48 DF, p-value: 0.03881 > summary(alphaols(sjd.vecm1, reg.number=1)) Call: lm(formula = R0[, reg.number] ~ -1 + RKV) Residuals: Min 1Q Median 3Q Max -0.039482 -0.014437 -0.005498 0.013169 0.051973 Coefficients: Estimate Std. Error t value Pr(>|t|) RKV1 -2.130e-01 6.039e-02 -3.526 0.000938 *** RKV2 -4.815e-03 4.028e-02 -0.120 0.905341 RKV3 3.501e-02 2.184e-02 1.603 0.115453 RKV4 2.029e-03 2.815e-03 0.721 0.474633 RKV5 -1.251e-12 3.123e-02 -4.01e-11 1.000000 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.02001 on 48 degrees of freedom Multiple R-Squared: 0.2446, Adjusted R-squared: 0.1659 F-statistic: 3.108 on 5 and 48 DF, p-value: 0.01647 > > > > cleanEx(); ..nameEx <- "alrtest" > > ### * alrtest > > flush(stderr()); flush(stdout()) > > ### Name: alrtest > ### Title: Likelihood ratio test for restrictions on alpha > ### Aliases: alrtest > ### Keywords: regression > > ### ** Examples > > data(denmark) > sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] > sjd.vecm <- ca.jo(sjd, constant=TRUE, 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)) ###################### # Johansen-Procedure # ###################### Estimation and testing under linear restrictions on beta The VECM has been estimated subject to: beta=H*phi and/or alpha=A*psi [,1] [1,] 1 [2,] 0 [3,] 0 [4,] 0 Eigenvalues of restricted VAR (lambda): [1] 0.3573 0.0000 0.0000 0.0000 0.0000 The value of the likelihood ratio test statistic: 6.66 distributed as chi square with 3 df. The p-value of the test statistic is: 0.08 Eigenvectors, normalised to first column of the restricted VAR: [,1] LRM 1.0000 LRY -0.9585 IBO 4.7641 IDE -2.5708 -6.5825 Weights W of the restricted VAR: [,1] [1,] -0.2543 [2,] 0.0000 [3,] 0.0000 [4,] 0.0000 > > > > cleanEx(); ..nameEx <- "bh5lrtest" > > ### * bh5lrtest > > flush(stderr()); flush(stdout()) > > ### Name: bh5lrtest > ### Title: Likelihood ratio test for restrictions under partly known beta > ### Aliases: bh5lrtest > ### Keywords: regression > > ### ** Examples > > 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, ctable='A1') > H51 <- c(1, -1, -1, 0, 0) > H52 <- c(0, 0, 0, 1, -1) > summary(bh5lrtest(H1, H=H51, r=2)) ###################### # Johansen-Procedure # ###################### Estimation and testing under partly known beta The VECM has been estimated subject to: beta=H*phi and/or alpha=A*psi [,1] [1,] 1 [2,] -1 [3,] -1 [4,] 0 [5,] 0 Eigenvalues of restricted VAR (lambda): [1] 0.3956 0.2812 0.2541 0.1008 The value of the likelihood ratio test statistic: 14.52 distributed as chi square with 3 df. The p-value of the test statistic is: 0 Eigenvectors, normalised to first column of the restricted VAR: [,1] [,2] [1,] 1 1.0000 [2,] -1 0.7845 [3,] -1 0.2155 [4,] 0 -64.9725 [5,] 0 -40.7031 Weights W of the restricted VAR: [,1] [,2] [1,] -0.0744 -0.0031 [2,] -0.0147 -0.0009 [3,] 0.0724 0.0057 [4,] 0.0164 0.0020 [5,] 0.0416 0.0035 > summary(bh5lrtest(H1, H=H52, r=2)) ###################### # Johansen-Procedure # ###################### Estimation and testing under partly known beta The VECM has been estimated subject to: beta=H*phi and/or alpha=A*psi [,1] [1,] 0 [2,] 0 [3,] 0 [4,] 1 [5,] -1 Eigenvalues of restricted VAR (lambda): [1] 0.4064 0.2607 0.1052 0.1007 The value of the likelihood ratio test statistic: 1.89 distributed as chi square with 3 df. The p-value of the test statistic is: 0.59 Eigenvectors, normalised to first column of the restricted VAR: [,1] [,2] [1,] 0 1.0000 [2,] 0 -0.9102 [3,] 0 -0.9334 [4,] 1 -2.6163 [5,] -1 -2.6163 Weights W of the restricted VAR: [,1] [,2] [1,] 0.0881 -0.0678 [2,] -0.0597 -0.0189 [3,] -0.2731 0.0975 [4,] -0.1450 0.0320 [5,] 0.2197 0.0625 > > > > cleanEx(); ..nameEx <- "bh6lrtest" > > ### * bh6lrtest > > flush(stderr()); flush(stdout()) > > ### Name: bh6lrtest > ### Title: Likelihood ratio test for restrictions under partly known beta > ### in a subspace > ### Aliases: bh6lrtest > ### Keywords: regression > > ### ** Examples > > 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, ctable='A1') > 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) ##################################################### # Johansen-Procedure Unit Root / Cointegration Test # ##################################################### The value of the test statistic is: 4.9312 > > > > cleanEx(); ..nameEx <- "blrtest" > > ### * blrtest > > flush(stderr()); flush(stdout()) > > ### Name: blrtest > ### Title: Likelihood ratio test for restrictions on beta > ### Aliases: blrtest > ### Keywords: regression > > ### ** Examples > > data(denmark) > sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] > sjd.vecm <- ca.jo(sjd, constant=TRUE, 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)) ###################### # Johansen-Procedure # ###################### Estimation and testing under linear restrictions on beta The VECM has been estimated subject to: beta=H*phi and/or alpha=A*psi [,1] [,2] [,3] [,4] [1,] -1 0 0 0 [2,] 1 0 0 0 [3,] 0 1 0 0 [4,] 0 0 1 0 [5,] 0 0 0 1 Eigenvalues of restricted VAR (lambda): [1] 0.4327 0.1722 0.0436 0.0056 The value of the likelihood ratio test statistic: 0.04 distributed as chi square with 1 df. The p-value of the test statistic is: 0.84 Eigenvectors, normalised to first column of the restricted VAR: [,1] [,2] [,3] [,4] [1,] 1.0000 1.0000 1.0000 1.0000 [2,] -1.0000 -1.0000 -1.0000 -1.0000 [3,] 5.3004 0.2293 99.7012 1.5513 [4,] -4.2904 8.9614 -51.8139 -2.0206 [5,] -6.2645 -6.6551 -13.4082 -5.8223 Weights W of the restricted VAR: [,1] [,2] [,3] [,4] [1,] -0.2120 -0.0195 4e-04 0.0131 [2,] 0.1075 -0.0061 2e-04 0.0196 [3,] 0.0226 -0.0097 -4e-04 0.0003 [4,] 0.0297 -0.0226 0e+00 -0.0021 > > > > cleanEx(); ..nameEx <- "ca.jo" > > ### * ca.jo > > flush(stderr()); flush(stdout()) > > ### Name: ca.jo > ### Title: Johansen Procedure for VAR > ### Aliases: ca.jo > ### Keywords: regression > > ### ** Examples > > data(denmark) > sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] > sjd.vecm <- ca.jo(sjd, constant=TRUE, type="eigen", K=2, spec="longrun", + season=4, ctable="A3") > summary(sjd.vecm) ###################### # Johansen-Procedure # ###################### Test type: maximal eigenvalue statistic (lambda max) , without linear trend and constant in cointegration Eigenvalues (lambda): [1] 4.331654e-01 1.775836e-01 1.127905e-01 4.341130e-02 -7.559584e-17 Values of teststatistic & critical values of test: test 10% 5% 1% r <= 3 | 2.35 7.56 9.09 12.74 r <= 2 | 6.34 13.78 15.75 19.83 r <= 1 | 10.36 19.80 21.89 26.41 r = 0 | 30.09 25.61 28.17 33.12 Eigenvectors, normalised to first column: (These are the cointegration relations) [,1] [,2] [,3] [,4] [,5] LRM 1.000000 1.0000000 1.0000000 1.000000 1.0000000 LRY -1.032949 -1.3681031 -3.2266580 -1.883625 -0.6336946 IBO 5.206919 0.2429825 0.5382847 24.399487 1.6965828 IDE -4.215879 6.8411103 -5.6473903 -14.298037 -1.8951589 constant -6.059932 -4.2708474 7.8963696 -2.263224 -8.0330127 Weights W: (This is the loading matrix) [,1] [,2] [,3] [,4] [,5] [1,] -0.21295494 -0.00481498 0.035011128 2.028908e-03 -2.265540e-13 [2,] 0.11502204 0.01975028 0.049938460 1.108654e-03 5.846654e-13 [3,] 0.02317724 -0.01059605 0.003480357 -1.573742e-03 3.523165e-14 [4,] 0.02941109 -0.03022917 -0.002811506 -4.767627e-05 -3.456735e-14 > # > data(finland) > sjf <- finland > sjf.vecm <- ca.jo(sjf, constant=FALSE, type="eigen", K=2, + spec="longrun", season=4, ctable="A2") > summary(sjf.vecm) ###################### # Johansen-Procedure # ###################### Test type: maximal eigenvalue statistic (lambda max) , with linear trend Eigenvalues (lambda): [1] 0.30932660 0.22599561 0.07308056 0.02946699 Values of teststatistic & critical values of test: test 10% 5% 1% r <= 3 | 3.11 6.69 8.08 11.58 r <= 2 | 7.89 12.78 14.60 18.78 r <= 1 | 26.64 18.96 21.28 26.15 r = 0 | 38.49 24.92 27.34 32.62 Eigenvectors, normalised to first column: (These are the cointegration relations) [,1] [,2] [,3] [,4] lrm1 1.0000000 1.000000 1.0000000 1.000000 lny -0.9763252 -1.323191 -0.9199865 1.608739 lnmr -7.0910749 -2.016033 0.2691516 -1.375342 difp -7.0191097 22.740851 -1.8223931 -15.686927 Weights W: (This is the loading matrix) [,1] [,2] [,3] [,4] [1,] 0.033342108 -0.020280528 -0.129947614 -0.002561906 [2,] 0.022544782 -0.005717446 0.012949130 -0.006265406 [3,] 0.053505000 0.046876449 -0.007367715 0.002173242 [4,] 0.005554849 -0.017353903 0.014561151 0.001531004 > > > > cleanEx(); ..nameEx <- "ca.po" > > ### * ca.po > > flush(stderr()); flush(stdout()) > > ### Name: ca.po > ### Title: Phillips & Ouliaris Cointegration Test > ### Aliases: ca.po > ### Keywords: regression > > ### ** Examples > > 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) ###################################### # Phillips & Ouliaris Unit Root Test # ###################################### Test of type Pz detrending of series none Response m3.real : Call: lm(formula = m3.real ~ zr - 1) Residuals: Min 1Q Median 3Q Max -0.578778 -0.261192 -0.007865 0.203497 1.065218 Coefficients: Estimate Std. Error t value Pr(>|t|) zrm3.real 0.99210 0.04147 23.920 <2e-16 *** zrgdp.real 0.08627 0.16348 0.528 0.603 zrrl -0.09819 0.16534 -0.594 0.559 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.3617 on 22 degrees of freedom Multiple R-Squared: 1, Adjusted R-squared: 0.9999 F-statistic: 1.584e+05 on 3 and 22 DF, p-value: < 2.2e-16 Response gdp.real : Call: lm(formula = gdp.real ~ zr - 1) Residuals: Min 1Q Median 3Q Max -0.088196 -0.039820 0.005241 0.044033 0.091465 Coefficients: Estimate Std. Error t value Pr(>|t|) zrm3.real -0.020408 0.005853 -3.487 0.00209 ** zrgdp.real 1.073163 0.023070 46.518 < 2e-16 *** zrrl -0.022009 0.023334 -0.943 0.35581 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.05104 on 22 degrees of freedom Multiple R-Squared: 1, Adjusted R-squared: 1 F-statistic: 8.523e+05 on 3 and 22 DF, p-value: < 2.2e-16 Response rl : Call: lm(formula = rl ~ zr - 1) Residuals: Min 1Q Median 3Q Max -0.57215 -0.20139 0.04127 0.17227 0.59364 Coefficients: Estimate Std. Error t value Pr(>|t|) zrm3.real -0.05566 0.03661 -1.521 0.142616 zrgdp.real 0.27091 0.14429 1.878 0.073765 . zrrl 0.64773 0.14594 4.438 0.000207 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.3192 on 22 degrees of freedom Multiple R-Squared: 0.9962, Adjusted R-squared: 0.9956 F-statistic: 1906 on 3 and 22 DF, p-value: < 2.2e-16 Value of test-statistic is: 18.4658 Critical values of Pz are: 10% 5% 1% critical values 26.7022 32.9392 46.4097 > > > > cleanEx(); ..nameEx <- "cajolst" > > ### * cajolst > > flush(stderr()); flush(stdout()) > > ### Name: cajolst > ### Title: Testing Cointegrating Rank with Level Shift at Unknown time > ### Aliases: cajolst > ### Keywords: regression > > ### ** Examples > > data(denmark) > sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] > sjd.lst <- cajolst(sjd, trend=TRUE, K=2, season=4) > summary(sjd.lst) ###################### # Johansen-Procedure # ###################### Test type: trace statistic , with linear trend in shift correction Eigenvalues (lambda): [1] 0.42098147 0.27098513 0.17330604 0.06127991 Values of teststatistic & critical values of test: test 10% 5% 1% r <= 3 | 3.15 5.42 6.79 10.04 r <= 2 | 11.62 13.78 15.83 19.85 r <= 1 | 24.33 25.93 28.45 33.76 r = 0 | 42.95 42.08 45.20 51.60 Eigenvectors, normalised to first column: (These are the cointegration relations) [,1] [,2] [,3] [,4] LRM 1.0000000 1.000000 1.0000000 1.0000000 LRY 0.8490645 -2.319498 -1.8603632 -0.2148260 IBO 6.0747337 6.824430 0.8571653 0.4685797 IDE 1.0858006 -11.662840 2.7346259 -0.5253649 Weights W: (This is the loading matrix) [,1] [,2] [,3] [,4] [1,] -0.146180842 -0.034940907 0.04306167 -0.066397980 [2,] -0.081222325 0.090040394 0.10130486 -0.011416802 [3,] -0.021090906 0.002883555 -0.01985965 0.030806000 [4,] 0.004947721 0.022143257 -0.03940262 0.008027878 > > > > cleanEx(); ..nameEx <- "cajools" > > ### * cajools > > flush(stderr()); flush(stdout()) > > ### Name: cajools > ### Title: OLS regression of VECM > ### Aliases: cajools > ### Keywords: regression > > ### ** Examples > > data(denmark) > sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] > sjd.vecm1 <- ca.jo(sjd, constant=TRUE, type="eigen", K=2, spec="longrun", + season=4) > sjd.vecm2 <- ca.jo(sjd, constant=TRUE, type="eigen", K=2, spec="transitory", + season=4) > sjd.vecm.ols1 <- cajools(sjd.vecm1) > sjd.vecm.ols2 <- cajools(sjd.vecm2) > summary(sjd.vecm.ols1) Response Y1 : Call: lm(formula = Y1 ~ z@Z1 + z@ZK - 1) Residuals: Min 1Q Median 3Q Max -0.039482 -0.014437 -0.005498 0.013169 0.051973 Coefficients: Estimate Std. Error t value Pr(>|t|) z@Z11 0.014228 0.201655 0.071 0.94409 z@Z12 0.013753 0.166549 0.083 0.93459 z@Z13 -1.180148 0.393173 -3.002 0.00456 ** z@Z14 0.176409 0.598347 0.295 0.76961 z@Z15 -0.055917 0.010563 -5.294 4.34e-06 *** z@Z16 -0.016458 0.009426 -1.746 0.08831 . z@Z17 -0.039480 0.008961 -4.406 7.40e-05 *** z@ZKLRM -0.180730 0.088757 -2.036 0.04822 * z@ZKLRY 0.109768 0.120060 0.914 0.36592 z@ZKIBO -1.041659 0.353320 -2.948 0.00526 ** z@ZKIDE 0.638122 0.434247 1.469 0.14933 z@ZK 1.582925 0.547678 2.890 0.00613 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.02165 on 41 degrees of freedom Multiple R-Squared: 0.6804, Adjusted R-squared: 0.5868 F-statistic: 7.273 on 12 and 41 DF, p-value: 6.759e-07 Response Y2 : Call: lm(formula = Y2 ~ z@Z1 + z@ZK - 1) Residuals: Min 1Q Median 3Q Max -0.034479 -0.015065 -0.001000 0.011147 0.056657 Coefficients: Estimate Std. Error t value Pr(>|t|) z@Z11 0.689838 0.206656 3.338 0.00180 ** z@Z12 -0.353616 0.170679 -2.072 0.04461 * z@Z13 0.280519 0.402923 0.696 0.49023 z@Z14 -0.587402 0.613185 -0.958 0.34370 z@Z15 -0.025121 0.010825 -2.321 0.02536 * z@Z16 0.007339 0.009660 0.760 0.45179 z@Z17 -0.011369 0.009183 -1.238 0.22276 z@ZKLRM 0.185819 0.090958 2.043 0.04752 * z@ZKLRY -0.309055 0.123038 -2.512 0.01604 * z@ZKIBO 0.657641 0.362082 1.816 0.07664 . z@ZKIDE -0.647679 0.445015 -1.455 0.15317 z@ZK -0.389553 0.561260 -0.694 0.49155 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.02218 on 41 degrees of freedom Multiple R-Squared: 0.4015, Adjusted R-squared: 0.2264 F-statistic: 2.292 on 12 and 41 DF, p-value: 0.02421 Response Y3 : Call: lm(formula = Y3 ~ z@Z1 + z@ZK - 1) Residuals: Min 1Q Median 3Q Max -2.327e-02 -4.445e-03 -3.026e-05 4.853e-03 1.764e-02 Coefficients: Estimate Std. Error t value Pr(>|t|) z@Z11 0.0654218 0.0802292 0.815 0.4195 z@Z12 0.1179269 0.0662622 1.780 0.0825 . z@Z13 0.3825684 0.1564254 2.446 0.0188 * z@Z14 0.0858928 0.2380548 0.361 0.7201 z@Z15 -0.0000689 0.0042027 -0.016 0.9870 z@Z16 0.0073995 0.0037503 1.973 0.0553 . z@Z17 0.0048269 0.0035652 1.354 0.1832 z@ZKLRM 0.0144878 0.0353122 0.410 0.6837 z@ZKLRY -0.0177100 0.0477665 -0.371 0.7127 z@ZKIBO 0.0815823 0.1405700 0.580 0.5648 z@ZKIDE -0.1673547 0.1727669 -0.969 0.3384 z@ZK -0.0641545 0.2178960 -0.294 0.7699 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.008613 on 41 degrees of freedom Multiple R-Squared: 0.3992, Adjusted R-squared: 0.2234 F-statistic: 2.27 on 12 and 41 DF, p-value: 0.02555 Response Y4 : Call: lm(formula = Y4 ~ z@Z1 + z@ZK - 1) Residuals: Min 1Q Median 3Q Max -9.125e-03 -2.876e-03 -1.527e-05 2.458e-03 1.490e-02 Coefficients: Estimate Std. Error t value Pr(>|t|) z@Z11 0.065001 0.050881 1.278 0.208607 z@Z12 -0.001606 0.042023 -0.038 0.969697 z@Z13 0.370309 0.099203 3.733 0.000576 *** z@Z14 -0.049376 0.150972 -0.327 0.745292 z@Z15 -0.004189 0.002665 -1.572 0.123709 z@Z16 -0.001087 0.002378 -0.457 0.650085 z@Z17 -0.002730 0.002261 -1.208 0.234120 z@ZKLRM -0.003677 0.022395 -0.164 0.870378 z@ZKLRY 0.020138 0.030293 0.665 0.509916 z@ZKIBO 0.143119 0.089148 1.605 0.116079 z@ZKIDE -0.314235 0.109567 -2.868 0.006498 ** z@ZK -0.071218 0.138187 -0.515 0.609062 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.005462 on 41 degrees of freedom Multiple R-Squared: 0.507, Adjusted R-squared: 0.3627 F-statistic: 3.514 on 12 and 41 DF, p-value: 0.001273 > summary(sjd.vecm.ols2) Response Y1 : Call: lm(formula = Y1 ~ z@Z1 + z@ZK - 1) Residuals: Min 1Q Median 3Q Max -0.039482 -0.014437 -0.005498 0.013169 0.051973 Coefficients: Estimate Std. Error t value Pr(>|t|) z@Z11 0.194958 0.176615 1.104 0.27609 z@Z12 -0.096016 0.157827 -0.608 0.54630 z@Z13 -0.138489 0.436917 -0.317 0.75288 z@Z14 -0.461713 0.576711 -0.801 0.42798 z@Z15 -0.055917 0.010563 -5.294 4.34e-06 *** z@Z16 -0.016458 0.009426 -1.746 0.08831 . z@Z17 -0.039480 0.008961 -4.406 7.40e-05 *** z@ZKLRM -0.180730 0.088757 -2.036 0.04822 * z@ZKLRY 0.109768 0.120060 0.914 0.36592 z@ZKIBO -1.041659 0.353320 -2.948 0.00526 ** z@ZKIDE 0.638122 0.434247 1.469 0.14933 z@ZK 1.582925 0.547678 2.890 0.00613 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.02165 on 41 degrees of freedom Multiple R-Squared: 0.6804, Adjusted R-squared: 0.5868 F-statistic: 7.273 on 12 and 41 DF, p-value: 6.759e-07 Response Y2 : Call: lm(formula = Y2 ~ z@Z1 + z@ZK - 1) Residuals: Min 1Q Median 3Q Max -0.034479 -0.015065 -0.001000 0.011147 0.056657 Coefficients: Estimate Std. Error t value Pr(>|t|) z@Z11 0.504019 0.180994 2.785 0.00807 ** z@Z12 -0.044561 0.161741 -0.276 0.78431 z@Z13 -0.377122 0.447752 -0.842 0.40453 z@Z14 0.060277 0.591012 0.102 0.91926 z@Z15 -0.025121 0.010825 -2.321 0.02536 * z@Z16 0.007339 0.009660 0.760 0.45179 z@Z17 -0.011369 0.009183 -1.238 0.22276 z@ZKLRM 0.185819 0.090958 2.043 0.04752 * z@ZKLRY -0.309055 0.123038 -2.512 0.01604 * z@ZKIBO 0.657641 0.362082 1.816 0.07664 . z@ZKIDE -0.647679 0.445015 -1.455 0.15317 z@ZK -0.389553 0.561260 -0.694 0.49155 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.02218 on 41 degrees of freedom Multiple R-Squared: 0.4015, Adjusted R-squared: 0.2264 F-statistic: 2.292 on 12 and 41 DF, p-value: 0.02421 Response Y3 : Call: lm(formula = Y3 ~ z@Z1 + z@ZK - 1) Residuals: Min 1Q Median 3Q Max -2.327e-02 -4.445e-03 -3.026e-05 4.853e-03 1.764e-02 Coefficients: Estimate Std. Error t value Pr(>|t|) z@Z11 0.0509340 0.0702669 0.725 0.4727 z@Z12 0.1356369 0.0627923 2.160 0.0367 * z@Z13 0.3009861 0.1738292 1.732 0.0909 . z@Z14 0.2532475 0.2294467 1.104 0.2761 z@Z15 -0.0000689 0.0042027 -0.016 0.9870 z@Z16 0.0073995 0.0037503 1.973 0.0553 . z@Z17 0.0048269 0.0035652 1.354 0.1832 z@ZKLRM 0.0144878 0.0353122 0.410 0.6837 z@ZKLRY -0.0177100 0.0477665 -0.371 0.7127 z@ZKIBO 0.0815823 0.1405700 0.580 0.5648 z@ZKIDE -0.1673547 0.1727669 -0.969 0.3384 z@ZK -0.0641545 0.2178960 -0.294 0.7699 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.008613 on 41 degrees of freedom Multiple R-Squared: 0.3992, Adjusted R-squared: 0.2234 F-statistic: 2.27 on 12 and 41 DF, p-value: 0.02555 Response Y4 : Call: lm(formula = Y4 ~ z@Z1 + z@ZK - 1) Residuals: Min 1Q Median 3Q Max -9.125e-03 -2.876e-03 -1.527e-05 2.458e-03 1.490e-02 Coefficients: Estimate Std. Error t value Pr(>|t|) z@Z11 0.068678 0.044563 1.541 0.1310 z@Z12 -0.021744 0.039822 -0.546 0.5880 z@Z13 0.227189 0.110241 2.061 0.0457 * z@Z14 0.264860 0.145513 1.820 0.0760 . z@Z15 -0.004189 0.002665 -1.572 0.1237 z@Z16 -0.001087 0.002378 -0.457 0.6501 z@Z17 -0.002730 0.002261 -1.208 0.2341 z@ZKLRM -0.003677 0.022395 -0.164 0.8704 z@ZKLRY 0.020138 0.030293 0.665 0.5099 z@ZKIBO 0.143119 0.089148 1.605 0.1161 z@ZKIDE -0.314235 0.109567 -2.868 0.0065 ** z@ZK -0.071218 0.138187 -0.515 0.6091 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.005462 on 41 degrees of freedom Multiple R-Squared: 0.507, Adjusted R-squared: 0.3627 F-statistic: 3.514 on 12 and 41 DF, p-value: 0.001273 > > > > cleanEx(); ..nameEx <- "lttest" > > ### * lttest > > flush(stderr()); flush(stdout()) > > ### Name: lttest > ### Title: Likelihood ratio test for no linear trend in VAR > ### Aliases: lttest > ### Keywords: regression > > ### ** Examples > > data(denmark) > sjd <- as.matrix(denmark[, c("LRM", "LRY", "IBO", "IDE")]) > sjd.vecm <- ca.jo(sjd, constant=TRUE, type="eigen", K=2, spec="longrun", + season=4) > lttest(sjd.vecm, r=1) LR-test for no linear trend H0: H*2(r<=1) H1: H2(r<=1) Test statistic is distributed as chi-square with 3 degress of freedom test statistic p-value LR test 1.98 0.58 > # > data(finland) > sjf <- as.matrix(finland) > sjf.vecm <- ca.jo(sjf, constant=FALSE, type="eigen", K=2, + spec="longrun", season=4) > lttest(sjf.vecm, r=3) LR-test for no linear trend H0: H*2(r<=3) H1: H2(r<=3) Test statistic is distributed as chi-square with 1 degress of freedom test statistic p-value LR test 4.78 0.03 > > > > cleanEx(); ..nameEx <- "plot-methods" > > ### * plot-methods > > flush(stderr()); flush(stdout()) > > ### Name: plot-methods > ### Title: Methods for Function plot in Package `urca' > ### Aliases: plot plot-methods plot,ur.ers,missing-method > ### plot,ur.kpss,missing-method plot,ca.jo,missing-method > ### plot,ca.po,missing-method plot,ur.pp,missing-method > ### plot,ur.sp,missing-method plot,ur.za,missing-method > ### Keywords: methods > > ### ** Examples > > 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, constant=TRUE, type="eigen", K=2, season=4) > plot(sjd.vecm) > > > > cleanEx(); ..nameEx <- "plotres" > > ### * plotres > > flush(stderr()); flush(stdout()) > > ### Name: plotres > ### Title: Graphical inspection of VECM residuals > ### Aliases: plotres > ### Keywords: regression > > ### ** Examples > > data(denmark) > sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] > sjd.vecm <- ca.jo(sjd, constant=TRUE, type="eigen", K=2, spec="longrun", + season=4) > plotres(sjd.vecm) > > > > cleanEx(); ..nameEx <- "show-methods" > > ### * show-methods > > flush(stderr()); flush(stdout()) > > ### Name: show-methods > ### Title: Methods for Function show in Package `urca' > ### Aliases: show show-methods show,ur.ers-method show,ur.kpss-method > ### show,ca.jo-method show,ca.po-method show,cajo.test-method > ### show,ur.pp-method show,ur.df-method show,ur.sp-method > ### show,ur.za-method show,sumurca-method > ### Keywords: methods > > ### ** Examples > > 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) ############################################################# # Elliot, Rothenberg & Stock Unit Root / Cointegration Test # ############################################################# The value of the test statistic is: -0.9499 > # > kpss.gnp <- ur.kpss(gnp.l, type="tau", lags="short") > show(kpss.gnp) ####################################### # KPSS Unit Root / Cointegration Test # ####################################### The value of the test statistic is: 0.1976 > # > pp.gnp <- ur.pp(gnp, type="Z-tau", model="trend", lags="short") > show(pp.gnp) ################################################## # Phillips-Perron Unit Root / Cointegration Test # ################################################## The value of the test statistic is: -0.7734 > # > df.gnp <- ur.df(gnp, type="trend", lags=4) > show(df.gnp) ############################################################### # Augmented Dickey-Fuller Test Unit Root / Cointegration Test # ############################################################### The value of the test statistic is: -0.6614 4.2327 3.2833 > # > sp.gnp <- ur.sp(gnp, type="tau", pol.deg=1, signif=0.01) > show(sp.gnp) ################################################### # Schmidt-Phillips Unit Root / Cointegration Test # ################################################### The value of the test statistic is: -1.3732 > # > za.gnp <- ur.za(gnp, model="both", lag=2) > show(za.gnp) ################################################ # Zivot-Andrews Unit Root / Cointegration Test # ################################################ The value of the test statistic is: -3.8431 > # > data(denmark) > sjd <- denmark[, c("LRM", "LRY", "IBO", "IDE")] > sjd.vecm <- ca.jo(sjd, constant=TRUE, type="eigen", K=2, season=4) > show(sjd.vecm) ##################################################### # Johansen-Procedure Unit Root / Cointegration Test # ##################################################### The value of the test statistic is: 2.3522 6.3427 10.362 30.0875 > # > 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)) ##################################################### # Johansen-Procedure Unit Root / Cointegration Test # ##################################################### The value of the test statistic is: 0.0432 > > > > cleanEx(); ..nameEx <- "summary-methods" > > ### * summary-methods > > flush(stderr()); flush(stdout()) > > ### Name: summary-methods > ### Title: Methods for Function summary in Package `urca' > ### Aliases: summary summary-methods summary,ur.ers-method > ### summary,ur.kpss-method summary,ca.jo-method summary,cajo.test-method > ### summary,ca.po-method summary,ur.pp-method summary,ur.df-method > ### summary,ur.sp-method summary,ur.za-method > ### Keywords: methods > > ### ** Examples > > 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) ############################################# # Elliot, Rothenberg & Stock Unit Root Test # ############################################# Test of type DF-GLS detrending of series with intercept and trend Call: lm(formula = dfgls.form, data = data.dfgls) Residuals: Min 1Q Median 3Q Max -44.3137 -10.2342 0.5835 10.1685 28.0779 Coefficients: Estimate Std. Error t value Pr(>|t|) yd.lag -0.034122 0.035922 -0.950 0.34656 yd.diff.lag1 0.452478 0.139331 3.247 0.00204 ** yd.diff.lag2 0.085861 0.152483 0.563 0.57580 yd.diff.lag3 -0.008207 0.153899 -0.053 0.95767 yd.diff.lag4 -0.082233 0.144692 -0.568 0.57226 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 15.86 on 52 degrees of freedom Multiple R-Squared: 0.2294, Adjusted R-squared: 0.1553 F-statistic: 3.095 on 5 and 52 DF, p-value: 0.01609 Value of test-statistic is: -0.9499 Critical values of DF-GLS are: 1% 5% 10% critical values -3.58 -3.03 -2.74 > # > kpss.gnp <- ur.kpss(gnp.l, type="tau", lags="short") > summary(kpss.gnp) ####################### # KPSS Unit Root Test # ####################### Test is of type: tau with 3 lags. Value of test-statistic is: 0.1976 Critical value for a significance level of: 10% 5% 2.5% 1% critical values 0.119 0.146 0.176 0.216 > # > pp.gnp <- ur.pp(gnp, type="Z-tau", model="trend", lags="short") > summary(pp.gnp) ################################## # Phillips-Perron Unit Root Test # ################################## Test regression with intercept and trend Call: lm(formula = y ~ y.l1 + trend) Residuals: Min 1Q Median 3Q Max -54.683 -8.176 2.394 11.843 27.884 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 14.01374 9.93593 1.410 0.164 y.l1 0.98538 0.03301 29.849 <2e-16 *** trend 0.50203 0.32292 1.555 0.125 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 15.75 on 58 degrees of freedom Multiple R-Squared: 0.9926, Adjusted R-squared: 0.9924 F-statistic: 3896 on 2 and 58 DF, p-value: < 2.2e-16 Value of test-statistic, type: Z-tau is: -0.7734 aux. Z statistics Z-tau-mu 0.7316 Z-tau-beta 1.6657 Critical values for Z statistics: 1% 5% 10% critical values -4.113484 -3.483605 -3.169576 > # > df.gnp <- ur.df(gnp, type="trend", lags=4) > summary(df.gnp) ############################################### # Augmented Dickey-Fuller Test Unit Root Test # ############################################### Test regression trend Call: lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag) Residuals: Min 1Q Median 3Q Max -42.4921 -9.8872 0.9124 9.8612 25.6340 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -2.71394 4.63380 -0.586 0.561 z.lag.1 -0.02785 0.04211 -0.661 0.511 tt 0.61613 0.38509 1.600 0.116 z.diff.lag1 0.33761 0.14502 2.328 0.024 * z.diff.lag2 0.02606 0.15108 0.173 0.864 z.diff.lag3 -0.05841 0.15099 -0.387 0.701 z.diff.lag4 -0.19280 0.15010 -1.284 0.205 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 15.31 on 50 degrees of freedom Multiple R-Squared: 0.3033, Adjusted R-squared: 0.2197 F-statistic: 3.628 on 6 and 50 DF, p-value: 0.004582 Value of test-statistic is: -0.6614 4.2327 3.2833 Critical values for test statistics: 1% 5% 10% tau3 -4.04 -3.45 -3.15 phi2 6.50 4.88 4.16 phi3 8.73 6.49 5.47 > # > sp.gnp <- ur.sp(gnp, type="tau", pol.deg=1, signif=0.01) > summary(sp.gnp) ################################### # Schmidt-Phillips Unit Root Test # ################################### Call: lm(formula = sp.data) Residuals: Min 1Q Median 3Q Max -54.683 -8.176 2.394 11.843 27.884 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.80008 4.18871 -0.430 0.669 y.lagged 0.98538 0.03301 29.849 <2e-16 *** trend.exp1 0.50203 0.32292 1.555 0.125 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 15.75 on 58 degrees of freedom Multiple R-Squared: 0.9926, Adjusted R-squared: 0.9924 F-statistic: 3896 on 2 and 58 DF, p-value: < 2.2e-16 Value of test-statistic is: -1.3732 Critical value for a significance level of 0.01 is: -3.63 > # > za.gnp <- ur.za(gnp, model="both", lag=2) > summary(za.gnp) ################################ # Zivot-Andrews Unit Root Test # ################################ Call: lm(formula = testmat) Residuals: Min 1Q Median 3Q Max -39.753 -9.413 2.138 9.934 22.977 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 21.49068 10.25301 2.096 0.04096 * y.l1 0.77341 0.05896 13.118 < 2e-16 *** trend 1.19804 0.66346 1.806 0.07675 . y.dl1 0.39699 0.12608 3.149 0.00272 ** y.dl2 0.10503 0.13401 0.784 0.43676 du -25.44710 9.20734 -2.764 0.00788 ** dt 2.11456 0.84179 2.512 0.01515 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 13.72 on 52 degrees of freedom Multiple R-Squared: 0.9948, Adjusted R-squared: 0.9942 F-statistic: 1651 on 6 and 52 DF, p-value: < 2.2e-16 Teststatistic: -3.8431 Critical values: 0.01= -5.57 0.05= -5.08 0.1= -4.82 Potential break point at position: 21 > # > data(finland) > sjf <- finland > sjf.vecm <- ca.jo(sjf, constant=FALSE, type="eigen", K=2, season=4) > summary(sjf.vecm) ###################### # Johansen-Procedure # ###################### Test type: maximal eigenvalue statistic (lambda max) , with linear trend Eigenvalues (lambda): [1] 0.30932660 0.22599561 0.07308056 0.02946699 Values of teststatistic & critical values of test: test 10% 5% 1% r <= 3 | 3.11 2.82 3.96 6.94 r <= 2 | 7.89 12.10 14.04 17.94 r <= 1 | 26.64 18.70 20.78 25.52 r = 0 | 38.49 24.71 27.17 31.94 Eigenvectors, normalised to first column: (These are the cointegration relations) [,1] [,2] [,3] [,4] lrm1 1.0000000 1.000000 1.0000000 1.000000 lny -0.9763252 -1.323191 -0.9199865 1.608739 lnmr -7.0910749 -2.016033 0.2691516 -1.375342 difp -7.0191097 22.740851 -1.8223931 -15.686927 Weights W: (This is the loading matrix) [,1] [,2] [,3] [,4] [1,] 0.033342108 -0.020280528 -0.129947614 -0.002561906 [2,] 0.022544782 -0.005717446 0.012949130 -0.006265406 [3,] 0.053505000 0.046876449 -0.007367715 0.002173242 [4,] 0.005554849 -0.017353903 0.014561151 0.001531004 > # > 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)) ###################### # Johansen-Procedure # ###################### Estimation and testing under linear restrictions on beta The VECM has been estimated subject to: beta=H*phi and/or alpha=A*psi [,1] [,2] [,3] [1,] -1 0 0 [2,] 1 0 0 [3,] 0 1 0 [4,] 0 0 1 Eigenvalues of restricted VAR (lambda): [1] 0.3093 0.1994 0.0705 The value of the likelihood ratio test statistic: 3.82 distributed as chi square with 3 df. The p-value of the test statistic is: 0.28 Eigenvectors, normalised to first column of the restricted VAR: [,1] [,2] [,3] [1,] 1.000 1.0000 1.0000 [2,] -1.000 -1.0000 -1.0000 [3,] -7.090 -1.4409 0.3503 [4,] -6.288 14.4392 -1.6555 Weights W of the restricted VAR: [,1] [,2] [,3] [1,] 0.0335 -0.0377 -0.1102 [2,] 0.0228 -0.0163 0.0238 [3,] 0.0543 0.0589 -0.0134 [4,] 0.0054 -0.0180 0.0113 > > > > cleanEx(); ..nameEx <- "ur.df" > > ### * ur.df > > flush(stderr()); flush(stdout()) > > ### Name: ur.df > ### Title: Augmented-Dickey-Fuller Unit Root Test > ### Aliases: ur.df > ### Keywords: regression > > ### ** Examples > > data(Raotbl3) > attach(Raotbl3) > lc.df <- ur.df(y=lc, lags=3, type='trend') > summary(lc.df) ############################################### # Augmented Dickey-Fuller Test Unit Root Test # ############################################### Test regression trend Call: lm(formula = z.diff ~ z.lag.1 + 1 + tt + z.diff.lag) Residuals: Min 1Q Median 3Q Max -0.0447139 -0.0065246 0.0001288 0.0062253 0.0453532 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.7976591 0.3547775 2.248 0.0270 * z.lag.1 -0.0758706 0.0338880 -2.239 0.0277 * tt 0.0004915 0.0002159 2.277 0.0252 * z.diff.lag1 -0.1063957 0.1006744 -1.057 0.2934 z.diff.lag2 0.2011373 0.1012373 1.987 0.0500 . z.diff.lag3 0.2998586 0.1020548 2.938 0.0042 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.01307 on 89 degrees of freedom Multiple R-Squared: 0.1472, Adjusted R-squared: 0.09924 F-statistic: 3.071 on 5 and 89 DF, p-value: 0.01325 Value of test-statistic is: -2.2389 3.7382 2.5972 Critical values for test statistics: 1% 5% 10% tau3 -4.04 -3.45 -3.15 phi2 6.50 4.88 4.16 phi3 8.73 6.49 5.47 > > > > cleanEx(); ..nameEx <- "ur.ers" > > ### * ur.ers > > flush(stderr()); flush(stdout()) > > ### Name: ur.ers > ### Title: Elliott, Rothenberg & Stock Unit Root Test > ### Aliases: ur.ers > ### Keywords: regression > > ### ** Examples > > data(nporg) > gnp <- na.omit(nporg[, "gnp.r"]) > ers.gnp <- ur.ers(gnp, type="DF-GLS", model="const", lag.max=4) > summary(ers.gnp) ############################################# # Elliot, Rothenberg & Stock Unit Root Test # ############################################# Test of type DF-GLS detrending of series with intercept Call: lm(formula = dfgls.form, data = data.dfgls) Residuals: Min 1Q Median 3Q Max -39.767 -6.011 4.775 14.896 31.454 Coefficients: Estimate Std. Error t value Pr(>|t|) yd.lag 0.02559 0.01793 1.427 0.15962 yd.diff.lag1 0.45630 0.14668 3.111 0.00303 ** yd.diff.lag2 0.06223 0.15879 0.392 0.69672 yd.diff.lag3 -0.02445 0.15965 -0.153 0.87886 yd.diff.lag4 -0.10768 0.15110 -0.713 0.47925 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 16.49 on 52 degrees of freedom Multiple R-Squared: 0.3825, Adjusted R-squared: 0.3231 F-statistic: 6.442 on 5 and 52 DF, p-value: 9.956e-05 Value of test-statistic is: 1.4268 Critical values of DF-GLS are: 1% 5% 10% critical values -2.6 -1.95 -1.62 > > > > cleanEx(); ..nameEx <- "ur.kpss" > > ### * ur.kpss > > flush(stderr()); flush(stdout()) > > ### Name: ur.kpss > ### Title: Kwiatkowski et al. Unit Root Test > ### Aliases: ur.kpss > ### Keywords: regression > > ### ** Examples > > 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) ####################### # KPSS Unit Root Test # ####################### Test is of type: tau with 3 lags. Value of test-statistic is: 0.1976 Critical value for a significance level of: 10% 5% 2.5% 1% critical values 0.119 0.146 0.176 0.216 > > > > cleanEx(); ..nameEx <- "ur.pp" > > ### * ur.pp > > flush(stderr()); flush(stdout()) > > ### Name: ur.pp > ### Title: Phillips & Perron Unit Root Test > ### Aliases: ur.pp > ### Keywords: regression > > ### ** Examples > > data(nporg) > gnp <- na.omit(nporg[, "gnp.r"]) > pp.gnp <- ur.pp(gnp, type="Z-tau", model="trend", lags="short") > summary(pp.gnp) ################################## # Phillips-Perron Unit Root Test # ################################## Test regression with intercept and trend Call: lm(formula = y ~ y.l1 + trend) Residuals: Min 1Q Median 3Q Max -54.683 -8.176 2.394 11.843 27.884 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 14.01374 9.93593 1.410 0.164 y.l1 0.98538 0.03301 29.849 <2e-16 *** trend 0.50203 0.32292 1.555 0.125 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 15.75 on 58 degrees of freedom Multiple R-Squared: 0.9926, Adjusted R-squared: 0.9924 F-statistic: 3896 on 2 and 58 DF, p-value: < 2.2e-16 Value of test-statistic, type: Z-tau is: -0.7734 aux. Z statistics Z-tau-mu 0.7316 Z-tau-beta 1.6657 Critical values for Z statistics: 1% 5% 10% critical values -4.113484 -3.483605 -3.169576 > > > > cleanEx(); ..nameEx <- "ur.sp" > > ### * ur.sp > > flush(stderr()); flush(stdout()) > > ### Name: ur.sp > ### Title: Schmidt & Phillips Unit Root Test > ### Aliases: ur.sp > ### Keywords: regression > > ### ** Examples > > data(nporg) > gnp <- na.omit(nporg[, "gnp.r"]) > sp.gnp <- ur.sp(gnp, type="tau", pol.deg=1, signif=0.01) > summary(sp.gnp) ################################### # Schmidt-Phillips Unit Root Test # ################################### Call: lm(formula = sp.data) Residuals: Min 1Q Median 3Q Max -54.683 -8.176 2.394 11.843 27.884 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.80008 4.18871 -0.430 0.669 y.lagged 0.98538 0.03301 29.849 <2e-16 *** trend.exp1 0.50203 0.32292 1.555 0.125 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 15.75 on 58 degrees of freedom Multiple R-Squared: 0.9926, Adjusted R-squared: 0.9924 F-statistic: 3896 on 2 and 58 DF, p-value: < 2.2e-16 Value of test-statistic is: -1.3732 Critical value for a significance level of 0.01 is: -3.63 > > > > cleanEx(); ..nameEx <- "ur.za" > > ### * ur.za > > flush(stderr()); flush(stdout()) > > ### Name: ur.za > ### Title: Zivot & Andrews Unit Root Test > ### Aliases: ur.za > ### Keywords: regression > > ### ** Examples > > data(nporg) > gnp <- na.omit(nporg[, "gnp.r"]) > za.gnp <- ur.za(gnp, model="both", lag=2) > summary(za.gnp) ################################ # Zivot-Andrews Unit Root Test # ################################ Call: lm(formula = testmat) Residuals: Min 1Q Median 3Q Max -39.753 -9.413 2.138 9.934 22.977 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 21.49068 10.25301 2.096 0.04096 * y.l1 0.77341 0.05896 13.118 < 2e-16 *** trend 1.19804 0.66346 1.806 0.07675 . y.dl1 0.39699 0.12608 3.149 0.00272 ** y.dl2 0.10503 0.13401 0.784 0.43676 du -25.44710 9.20734 -2.764 0.00788 ** dt 2.11456 0.84179 2.512 0.01515 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 13.72 on 52 degrees of freedom Multiple R-Squared: 0.9948, Adjusted R-squared: 0.9942 F-statistic: 1651 on 6 and 52 DF, p-value: < 2.2e-16 Teststatistic: -3.8431 Critical values: 0.01= -5.57 0.05= -5.08 0.1= -4.82 Potential break point at position: 21 > > > > ### *