currencysubstitution.RdCurrency Substitution Data.
data(currencysubstitution)A multivariate quarterly time series from 1960(4) to 1975(4) with variables
logarithm of the ratio of Canadian holdings of Canadian dollar balances and Canadian holdings of U.S. dollar balances,
yield on U.S. Treasury bills,
yield on Canadian Treasury bills,
logarithm of Canadian real gross national product.
The data was originally studied by Miles (1978), the data set is given in Krämer and Sonnberger (1986). Below we replicate a few examples from their book. Some of these results differ more or less seriously and are sometimes parameterized differently.
M. Miles (1978), Currency Substitution, Flexible Exchange Rates, and Monetary Independence. American Economic Review 68, 428–436
W. Krämer & H. Sonnberger (1986), The Linear Regression Model under Test. Heidelberg: Physica
data(currencysubstitution)
## page 130, fit Miles OLS model and Bordo-Choudri OLS model
## third and last line in Table 6.3
modelMiles <- logCUS ~ log((1+Iu)/(1+Ic))
lm(modelMiles, data=currencysubstitution)
#>
#> Call:
#> lm(formula = modelMiles, data = currencysubstitution)
#>
#> Coefficients:
#> (Intercept) log((1 + Iu)/(1 + Ic))
#> 2.562 5.871
#>
dwtest(modelMiles, data=currencysubstitution)
#>
#> Durbin-Watson test
#>
#> data: modelMiles
#> DW = 0.27024, p-value < 2.2e-16
#> alternative hypothesis: true autocorrelation is greater than 0
#>
modelBordoChoudri <- logCUS ~ I(Iu-Ic) + Ic + logY
lm(modelBordoChoudri, data=currencysubstitution)
#>
#> Call:
#> lm(formula = modelBordoChoudri, data = currencysubstitution)
#>
#> Coefficients:
#> (Intercept) I(Iu - Ic) Ic logY
#> -5.9782 -9.2158 -18.4563 0.8366
#>
dwtest(modelBordoChoudri, data=currencysubstitution)
#>
#> Durbin-Watson test
#>
#> data: modelBordoChoudri
#> DW = 0.53514, p-value = 2.261e-13
#> alternative hypothesis: true autocorrelation is greater than 0
#>
## page 131, fit test statistics in Table 6.4 b)
################################################
if(require(strucchange, quietly = TRUE)) {
## Fluctuation test
sctest(modelMiles, type="fluctuation", data=currencysubstitution,
rescale=FALSE) }
#>
#> RE test (recursive estimates test)
#>
#> data: modelMiles
#> RE = 3.1591, p-value = 8.583e-09
#>
## RESET
reset(modelMiles, data=currencysubstitution)
#>
#> RESET test
#>
#> data: modelMiles
#> RESET = 1.1308, df1 = 2, df2 = 57, p-value = 0.3299
#>
reset(modelMiles, power=2, type="regressor", data=currencysubstitution)
#>
#> RESET test
#>
#> data: modelMiles
#> RESET = 2.1078, df1 = 1, df2 = 58, p-value = 0.1519
#>
reset(modelMiles, type="princomp", data=currencysubstitution)
#>
#> RESET test
#>
#> data: modelMiles
#> RESET = 1.1308, df1 = 2, df2 = 57, p-value = 0.3299
#>
## Harvey-Collier
harvtest(modelMiles, order.by = ~log((1+Iu)/(1+Ic)), data=currencysubstitution)
#>
#> Harvey-Collier test
#>
#> data: modelMiles
#> HC = 0.86911, df = 58, p-value = 0.3884
#>
## Rainbow
raintest(modelMiles, order.by = "mahalanobis", data=currencysubstitution)
#>
#> Rainbow test
#>
#> data: modelMiles
#> Rain = 1.766, df1 = 31, df2 = 28, p-value = 0.06603
#>
## page 132, fit test statistics in Table 6.4 d)
################################################
if(require(strucchange, quietly = TRUE)) {
## Chow 1970(2)
sctest(modelBordoChoudri, point=c(1970,2), data=currencysubstitution,
type="Chow") }
#>
#> Chow test
#>
#> data: modelBordoChoudri
#> F = 14.572, p-value = 4.317e-08
#>
## Breusch-Pagan
bptest(modelBordoChoudri, data=currencysubstitution, studentize=FALSE)
#>
#> Breusch-Pagan test
#>
#> data: modelBordoChoudri
#> BP = 14.514, df = 3, p-value = 0.002283
#>
bptest(modelBordoChoudri, data=currencysubstitution)
#>
#> studentized Breusch-Pagan test
#>
#> data: modelBordoChoudri
#> BP = 10.736, df = 3, p-value = 0.01324
#>
## RESET
reset(modelBordoChoudri, data=currencysubstitution)
#>
#> RESET test
#>
#> data: modelBordoChoudri
#> RESET = 0.69314, df1 = 2, df2 = 55, p-value = 0.5043
#>
reset(modelBordoChoudri, power=2, type="regressor", data=currencysubstitution)
#>
#> RESET test
#>
#> data: modelBordoChoudri
#> RESET = 6.6775, df1 = 3, df2 = 54, p-value = 0.0006458
#>
reset(modelBordoChoudri, type="princomp", data=currencysubstitution)
#>
#> RESET test
#>
#> data: modelBordoChoudri
#> RESET = 8.2945, df1 = 2, df2 = 55, p-value = 0.0007107
#>
## Harvey-Collier
harvtest(modelBordoChoudri, order.by = ~ I(Iu-Ic), data=currencysubstitution)
#>
#> Harvey-Collier test
#>
#> data: modelBordoChoudri
#> HC = 0.75539, df = 56, p-value = 0.4532
#>
harvtest(modelBordoChoudri, order.by = ~ Ic, data=currencysubstitution)
#>
#> Harvey-Collier test
#>
#> data: modelBordoChoudri
#> HC = 0.40259, df = 56, p-value = 0.6888
#>
harvtest(modelBordoChoudri, order.by = ~ logY, data=currencysubstitution)
#>
#> Harvey-Collier test
#>
#> data: modelBordoChoudri
#> HC = 2.5016, df = 56, p-value = 0.01531
#>
## Rainbow
raintest(modelBordoChoudri, order.by = "mahalanobis", data=currencysubstitution)
#>
#> Rainbow test
#>
#> data: modelBordoChoudri
#> Rain = 3.7711, df1 = 31, df2 = 26, p-value = 0.0004604
#>