Last data update: 2014.03.03
R: US Macroeconomic Data (1957-2005, Stock & Watson)
US Macroeconomic Data (1957–2005, Stock & Watson)
Description
Time series data on 7 (mostly) US macroeconomic variables for 1957–2005.
Usage
data("USMacroSW")
Format
A quarterly multiple time series from 1957(1) to 2005(1) with 7 variables.
unemp Unemployment rate.
cpi Consumer price index.
ffrate Federal funds interest rate.
tbill 3-month treasury bill interest rate.
tbond 1-year treasury bond interest rate.
gbpusd GBP/USD exchange rate (US dollar in cents per British pound).
gdpjp GDP for Japan.
Details
The US Consumer Price Index is measured using monthly surveys
and is compiled by the Bureau of Labor Statistics (BLS). The
unemployment rate is computed from the BLS's Current Population. The quarterly data
used here were computed by averaging the monthly values. The interest data are the
monthly average of daily rates as reported by the Federal Reserve and the dollar-pound
exchange rate data are the monthly average of daily rates; both are for the final month in
the quarter. Japanese real GDP data were obtained from the OECD.
Source
Online complements to Stock and Watson (2007).
http://wps.aw.com/aw_stock_ie_2/
References
Stock, J.H. and Watson, M.W. (2007). Introduction to Econometrics , 2nd ed. Boston: Addison Wesley.
See Also
StockWatson2007
, USMacroSWM
, USMacroSWQ
,
USMacroB
, USMacroG
Examples
## Stock and Watson (2007)
data("USMacroSW", package = "AER")
library("dynlm")
library("strucchange")
usm <- ts.intersect(USMacroSW, 4 * 100 * diff(log(USMacroSW[, "cpi"])))
colnames(usm) <- c(colnames(USMacroSW), "infl")
## Equations 14.7, 14.13, 14.16, 14.17, pp. 536
fm_ar1 <- dynlm(d(infl) ~ L(d(infl)),
data = usm, start = c(1962,1), end = c(2004,4))
fm_ar4 <- dynlm(d(infl) ~ L(d(infl), 1:4),
data = usm, start = c(1962,1), end = c(2004,4))
fm_adl41 <- dynlm(d(infl) ~ L(d(infl), 1:4) + L(unemp),
data = usm, start = c(1962,1), end = c(2004,4))
fm_adl44 <- dynlm(d(infl) ~ L(d(infl), 1:4) + L(unemp, 1:4),
data = usm, start = c(1962,1), end = c(2004,4))
coeftest(fm_ar1, vcov = sandwich)
coeftest(fm_ar4, vcov = sandwich)
coeftest(fm_adl41, vcov = sandwich)
coeftest(fm_adl44, vcov = sandwich)
## Granger causality test mentioned on p. 547
waldtest(fm_ar4, fm_adl44, vcov = sandwich)
## Figure 14.5, p. 570
## SW perform partial break test of unemp coefs
## here full model is used
mf <- model.frame(fm_adl44) ## re-use fm_adl44
mf <- ts(as.matrix(mf), start = c(1962, 1), freq = 4)
colnames(mf) <- c("y", paste("x", 1:8, sep = ""))
ff <- as.formula(paste("y", "~", paste("x", 1:8, sep = "", collapse = " + ")))
fs <- Fstats(ff, data = mf, from = 0.1)
plot(fs)
lines(boundary(fs, alpha = 0.01), lty = 2, col = 2)
lines(boundary(fs, alpha = 0.1), lty = 3, col = 2)
## More examples can be found in:
## help("StockWatson2007")
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
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 an HTML browser interface to help.
Type 'q()' to quit R.
> library(AER)
Loading required package: car
Loading required package: lmtest
Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:base':
as.Date, as.Date.numeric
Loading required package: sandwich
Loading required package: survival
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/AER/USMacroSW.Rd_%03d_medium.png", width=480, height=480)
> ### Name: USMacroSW
> ### Title: US Macroeconomic Data (1957-2005, Stock & Watson)
> ### Aliases: USMacroSW
> ### Keywords: datasets
>
> ### ** Examples
>
> ## Stock and Watson (2007)
> data("USMacroSW", package = "AER")
> library("dynlm")
> library("strucchange")
> usm <- ts.intersect(USMacroSW, 4 * 100 * diff(log(USMacroSW[, "cpi"])))
> colnames(usm) <- c(colnames(USMacroSW), "infl")
>
> ## Equations 14.7, 14.13, 14.16, 14.17, pp. 536
> fm_ar1 <- dynlm(d(infl) ~ L(d(infl)),
+ data = usm, start = c(1962,1), end = c(2004,4))
> fm_ar4 <- dynlm(d(infl) ~ L(d(infl), 1:4),
+ data = usm, start = c(1962,1), end = c(2004,4))
> fm_adl41 <- dynlm(d(infl) ~ L(d(infl), 1:4) + L(unemp),
+ data = usm, start = c(1962,1), end = c(2004,4))
> fm_adl44 <- dynlm(d(infl) ~ L(d(infl), 1:4) + L(unemp, 1:4),
+ data = usm, start = c(1962,1), end = c(2004,4))
> coeftest(fm_ar1, vcov = sandwich)
t test of coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.017101 0.126145 0.1356 0.89233
L(d(infl)) -0.238047 0.095939 -2.4812 0.01407 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> coeftest(fm_ar4, vcov = sandwich)
t test of coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.022429 0.115912 0.1935 0.846799
L(d(infl), 1:4)1 -0.257943 0.091238 -2.8272 0.005271 **
L(d(infl), 1:4)2 -0.322031 0.079367 -4.0575 7.602e-05 ***
L(d(infl), 1:4)3 0.157609 0.082870 1.9019 0.058909 .
L(d(infl), 1:4)4 -0.030251 0.091685 -0.3299 0.741853
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> coeftest(fm_adl41, vcov = sandwich)
t test of coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.279561 0.526634 2.4297 0.0161775 *
L(d(infl), 1:4)1 -0.305587 0.086918 -3.5158 0.0005653 ***
L(d(infl), 1:4)2 -0.390967 0.089016 -4.3921 1.994e-05 ***
L(d(infl), 1:4)3 0.086472 0.084000 1.0294 0.3047748
L(d(infl), 1:4)4 -0.081073 0.088541 -0.9156 0.3611790
L(unemp) -0.212146 0.095227 -2.2278 0.0272387 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> coeftest(fm_adl44, vcov = sandwich)
t test of coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.304286 0.439631 2.9668 0.0034624 **
L(d(infl), 1:4)1 -0.419822 0.086345 -4.8622 2.714e-06 ***
L(d(infl), 1:4)2 -0.366630 0.091544 -4.0049 9.407e-05 ***
L(d(infl), 1:4)3 0.056568 0.082549 0.6853 0.4941479
L(d(infl), 1:4)4 -0.036458 0.081314 -0.4484 0.6544868
L(unemp, 1:4)1 -2.635568 0.462228 -5.7019 5.435e-08 ***
L(unemp, 1:4)2 3.043088 0.856420 3.5533 0.0004979 ***
L(unemp, 1:4)3 -0.377371 0.887477 -0.4252 0.6712384
L(unemp, 1:4)4 -0.248424 0.448296 -0.5542 0.5802345
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
> ## Granger causality test mentioned on p. 547
> waldtest(fm_ar4, fm_adl44, vcov = sandwich)
Wald test
Model 1: d(infl) ~ L(d(infl), 1:4)
Model 2: d(infl) ~ L(d(infl), 1:4) + L(unemp, 1:4)
Res.Df Df F Pr(>F)
1 167
2 163 4 8.9095 1.567e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
> ## Figure 14.5, p. 570
> ## SW perform partial break test of unemp coefs
> ## here full model is used
> mf <- model.frame(fm_adl44) ## re-use fm_adl44
> mf <- ts(as.matrix(mf), start = c(1962, 1), freq = 4)
> colnames(mf) <- c("y", paste("x", 1:8, sep = ""))
> ff <- as.formula(paste("y", "~", paste("x", 1:8, sep = "", collapse = " + ")))
> fs <- Fstats(ff, data = mf, from = 0.1)
> plot(fs)
> lines(boundary(fs, alpha = 0.01), lty = 2, col = 2)
> lines(boundary(fs, alpha = 0.1), lty = 3, col = 2)
>
> ## More examples can be found in:
> ## help("StockWatson2007")
>
>
>
>
>
> dev.off()
null device
1
>