Time Series (ver. 1.5)

Save this PDF as:

Size: px
Start display at page:

Transcription

1 Time Series (ver. 1.5) Oscar Torres-Reyna Data Consultant

2 If you have a format like date1 type Date variable -----STATA 10.x/11.x: gen datevar = date(date1,"dmy", 2012) format datevar %td /*For daily data*/ -----STATA 9.x: gen datevar = date(date1,"dmy", 2012) format datevar %td /*For daily data*/ If you have a format like date2 type -----STATA 10.x/11.x: gen datevar = date(date2,"mdy", 2012) format datevar %td /*For daily data*/ STATA 9.x: gen datevar = date(date2,"mdy", 2012) format datevar %td /*For daily data*/ If you have a format like date3 type STATA 10.x/11.x: tostring date3, gen(date3a) gen datevar=date(date3a,"ymd") format datevar %td /*For daily data*/ STATA 9.x: tostring date3, gen(date3a) gen year=substr(date3a,1,4) gen month=substr(date3a,5,2) gen day=substr(date3a,7,2) destring year month day, replace gen datevar1 = mdy(month,day,year) format datevar1 %td /*For daily data*/ If you have a format like date4 type See 2

3 If the original date variable is string (i.e. color red): gen week= weekly(stringvar,"wy") gen month= monthly(stringvar,"my") gen quarter= quarterly(stringvar,"qy") gen half = halfyearly(stringvar,"hy") gen year= yearly(stringvar,"y") Date variable (cont.) NOTE: Remember to format the date variable accordingly. After creating it type: format datevar %t? /*Change datevar with your date variable*/ Change? with the correct format: w (week), m (monthly), q (quarterly), h (half), y (yearly). If the components of the original date are in different numeric variables (i.e. color black): gen daily = mdy(month,day,year) gen week = yw(year, week) gen month = ym(year,month) gen quarter = yq(year,quarter) gen half = yh(year,half-year) NOTE: Remember to format the date variable accordingly. After creating it type: format datevar %t? /*Change datevar with your date variable*/ Change? with the correct format: w (week), m (monthly), q (quarterly), h (half), y (yearly). To extract days of the week (Monday, Tuesday, etc.) use the function dow() gen dayofweek= dow(date) Replace date with the date variable in your dataset. This will create the variable dayofweek where 0 is Sunday, 1 is Monday, etc. (type help dow for more details) To specify a range of dates (or integers in general) you can use the tin() and twithin() functions. tin() includes the first and last date, twithin() does not. Use the format of the date variable in your dataset. /* Make sure to set your data as time series before using tin/twithin */ tsset date regress y x1 x2 if tin(01jan1995,01jun1995) regress y x1 x2 if twithin(01jan2000,01jan2001) 3

4 Date variable (example) Time series data is data collected over time for a single or a group of variables. For this kind of data the first thing to do is to check the variable that contains the time or date range and make sure is the one you need: yearly, monthly, quarterly, daily, etc. The next step is to verify it is in the correct format. In the example below the time variable is stored in date but it is a string variable not a date variable. In Stata you need to convert this string variable to a date variable.* A closer inspection of the variable, for the years 2000 the format changes, we need to create a new variable with a uniform format. Type the following: use gen date1=substr(date,1,7) gen datevar=quarterly(date1,"yq") format datevar %tq browse date date1 datevar For more details type help date *Data source: Stock & Watson s companion materials

5 From daily/monthly date variable to quarterly use " clear *Quarterly date from daily date gen datevar=date(date2,"mdy", 2012) /*Date2 is a string date variable*/ format datevar %td gen quarterly = qofd(datevar) format quarterly %tq *Quarterly date from monthly date gen month = month(datevar) gen day=day(datevar) gen year=year(datevar) gen monthly = ym(year,month) format monthly %tm gen quarterly1 = qofd(dofm(monthly)) format quarterly1 %tq browse date2 datevar quarterly monthly quarterly1

6 From daily to weekly and getting yearly use " clear gen datevar = date(date2, "MDY", 2012) format datevar %td gen year= year(datevar) gen w = week(datevar) gen weekly = yw(year,w) format weekly %tw browse ******************************************************** * From daily to yearly gen year1 = year(datevar) * From quarterly to yearly gen year2 = yofd(dofq(quarterly)) * From weekly to yearly gen year3 = yofd(dofw(weekly))

7 Setting as time series: tsset Once you have the date variable in a date format you need to declare your data as time series in order to use the time series operators. In Stata type: tsset datevar. tsset datevar time variable: datevar, 1957q1 to 2005q1 delta: 1 quarter If you have gaps in your time series, for example there may not be data available for weekends. This complicates the analysis using lags for those missing dates. In this case you may want to create a continuous time trend as follows: gen time = _n Then use it to set the time series: tsset time In the case of cross-sectional time series type: sort panel date by panel: gen time = _n xtset panel time 6

8 Filling gaps in time variables Use the command tsfill to fill in the gap in the time series. You need to tset, tsset or xtset the data before using tsfill. In the example below: tset quarters tsfill Type help tsfill for more details. 7

9 Subsetting tin/twithin With tsset (time series set) you can use two time series commands: tin ( times in, from a to b) and twithin ( times within, between a and b, it excludes a and b). If you have yearly data just include the years.. list datevar unemp if tin(2000q1,2000q4) datevar unemp q q q q list datevar unemp if twithin(2000q1,2000q4) datevar unemp q q3 4 /* Make sure to set your data as time series before using tin/twithin */ tsset date regress y x1 x2 if tin(01jan1995,01jun1995) regress y x1 x2 if twithin(01jan2000,01jan2001) 8

10 See Merge/Append

11 Lag operators (lag) Another set of time series commands are the lags, leads, differences and seasonal operators. It is common to analyzed the impact of previous values on current ones. To generate values with past values use the L operator generate unempl1=l1.unemp generate unempl2=l2.unemp list datevar unemp unempl1 unempl2 in 1/5. generate unempl1=l1.unemp (1 missing value generated). generate unempl2=l2.unemp (2 missing values generated). list datevar unemp unempl1 unempl2 in 1/5 datevar unemp unempl1 unempl q q q q q In a regression you could type: or regress y x L1.x L2.x regress y x L(1/5).x 10

12 To generate forward or lead values use the F operator Lag operators (forward) generate unempf1=f1.unemp generate unempf2=f2.unemp list datevar unemp unempf1 unempf2 in 1/5. generate unempf1=f1.unemp (1 missing value generated). generate unempf2=f2.unemp (2 missing values generated). list datevar unemp unempf1 unempf2 in 1/5 datevar unemp unempf1 unempf q q q q q In a regression you could type: regress y x F1.x F2.x or regress y x F(1/5).x 11

13 Lag operators (difference) To generate the difference between current a previous values use the D operator generate unempd1=d1.unemp /* D1 = y t y t-1 */ generate unempd2=d2.unemp /* D2 = (y t y t-1 ) (y t-1 y t-2 ) */ list datevar unemp unempd1 unempd2 in 1/5. generate unempd1=d1.unemp (1 missing value generated). generate unempd2=d2.unemp (2 missing values generated). list datevar unemp unempd1 unempd2 in 1/5 datevar unemp unempd1 unempd q q q q q In a regression you could type: regress y x D1.x 12

14 To generate seasonal differences use the S operator Lag operators (seasonal) generate unemps1=s1.unemp /* S1 = y t y t-1 */ generate unemps2=s2.unemp /* S2 = (y t y t-2 ) */ list datevar unemp unemps1 unemps2 in 1/5. generate unemps1=s1.unemp (1 missing value generated). generate unemps2=s2.unemp (2 missing values generated). list datevar unemp unemps1 unemps2 in 1/5 datevar unemp unemps1 unemps q q q q q In a regression you could type: regress y x S1.x 13

15 To explore autocorrelation, which is the correlation between a variable and its previous values, use the command corrgram. The number of lags depend on theory, AIC/BIC process or experience. The output includes autocorrelation coefficient and partial correlations coefficients used to specify an ARIMA model. corrgram unemp, lags(12). corrgram unemp, lags(12) Correlograms: autocorrelation LAG AC PAC Q Prob>Q [Autocorrelation] [Partial Autocor] AC shows that the correlation between the current value of unemp and its value three quarters ago is AC can be use to define the q in MA(q) only in stationary series PAC shows that the correlation between the current value of unemp and its value three quarters ago is without the effect of the two previous lags. PAC can be used to define the p in AR(p) only in stationary series Box-Pierce Q statistic tests the null hypothesis that all correlation up to lag k are equal to 0. This series show significant autocorrelation as shown in the Prob>Q value which at any k are less than 0.05, therefore rejecting the null that all lags are not autocorrelated. Graphic view of AC which shows a slow decay in the trend, suggesting nonstationarity. See also the ac command. Graphic view of PAC which does not show spikes after the second lag which suggests that all other lags are mirrors of the second lag. See the pac command. 14

16 Correlograms: cross correlation The explore the relationship between two time series use the command xcorr. The graph below shows the correlation between GDP quarterly growth rate and unemployment. When using xcorr list the independent variable first and the dependent variable second. type xcorr gdp unemp, lags(10) xlabel(-10(1)10,grid). xcorr gdp unemp, lags(10) table Cross-correlations of gdp and unemp Cross-correlogram Lag LAG CORR [Cross-correlation] At lag 0 there is a negative immediate correlation between GDP growth rate and unemployment. This means that a drop in GDP causes an immediate increase in unemployment. 15

17 xcorr interest unemp, lags(10) xlabel(-10(1)10,grid) Correlograms: cross correlation Cross-correlations of interest and unemp Cross-correlogram Lag Interest rates have a positive effect on future level of unemployment, reaching the highest point at lag 8 (four quarters or two years). In this case, interest rates are positive correlated with unemployment rates eight quarters later xcorr interest unemp, lags(10) table LAG CORR [Cross-correlation]

18 Lag selection Too many lags could increase the error in the forecasts, too few could leave out relevant information*. Experience, knowledge and theory are usually the best way to determine the number of lags needed. There are, however, information criterion procedures to help come up with a proper number. Three commonly used are: Schwarz's Bayesian information criterion (SBIC), the Akaike's information criterion (AIC), and the Hannan and Quinn information criterion (HQIC). All these are reported by the command varsoc in Stata.. varsoc gdp cpi, maxlag(10) Selection-order criteria Sample: 1959q4-2005q1 Number of obs = 182 lag LL LR df p FPE AIC HQIC SBIC * * * * * Endogenous: gdp cpi Exogenous: _cons When all three agree, the selection is clear, but what happens when getting conflicting results? A paper from the CEPR suggests, in the context of VAR models, that AIC tends to be more accurate with monthly data, HQIC works better for quarterly data on samples over 120 and SBIC works fine with any sample size for quarterly data (on VEC models)**. In our example above we have quarterly data with 182 observations, HQIC suggest a lag of 4 (which is also suggested by AIC). * See Stock & Watson for more details and on how to estimate BIC and SIC ** Ivanov, V. and Kilian, L 'A Practitioner's Guide to Lag-Order Selection for Vector Autoregressions'. CEPR Discussion Paper no London, Centre for Economic Policy Research. 17

19 Having a unit root in a series mean that there is more than one trend in the series. Unit roots. regress unemp gdp if tin(1965q1,1981q4) Source SS df MS Number of obs = 68 F( 1, 66) = Model Prob > F = Residual R-squared = Adj R-squared = Total Root MSE = unemp Coef. Std. Err. t P> t [95% Conf. Interval] gdp _cons regress unemp gdp if tin(1982q1,2000q4) Source SS df MS Number of obs = 76 F( 1, 74) = 3.62 Model Prob > F = Residual R-squared = Adj R-squared = Total Root MSE = unemp Coef. Std. Err. t P> t [95% Conf. Interval] gdp _cons

20 Unemployment rate. line unemp datevar Unit roots Unemployment Rate q1 1969q1 1981q1 1993q1 2005q1 datevar 19

21 Unit root test The Dickey-Fuller test is one of the most commonly use tests for stationarity. The null hypothesis is that the series has a unit root. The test statistic shows that the unemployment series have a unit root, it lies within the acceptance region. One way to deal with stochastic trends (unit root) is by taking the first difference of the variable (second test below).. dfuller unemp, lag(5) Augmented Dickey-Fuller test for unit root Number of obs = 187 Unit root Interpolated Dickey-Fuller Test 1% Critical 5% Critical 10% Critical Statistic Value Value Value Z(t) MacKinnon approximate p-value for Z(t) = dfuller unempd1, lag(5) Augmented Dickey-Fuller test for unit root Number of obs = 186 No unit root Interpolated Dickey-Fuller Test 1% Critical 5% Critical 10% Critical Statistic Value Value Value Z(t) MacKinnon approximate p-value for Z(t) =

22 Testing for cointegration Cointegration refers to the fact that two or more series share an stochastic trend (Stock & Watson). Engle and Granger (1987) suggested a two step process to test for cointegration (an OLS regression and a unit root test), the EG-ADF test. regress unemp gdp Run an OLS regression predict e, resid dfuller e, lags(10) Get the residuals Run a unit root test on the residuals. Augmented Dickey-Fuller test for unit root Number of obs = 181 Unit root* Interpolated Dickey-Fuller Test 1% Critical 5% Critical 10% Critical Statistic Value Value Value Z(t) MacKinnon approximate p-value for Z(t) = Both variables are not cointegrated See Stock & Watson for a table of critical values for the unit root test and the theory behind. *Critical value for one independent variable in the OLS regression, at 5% is (Stock & Watson) 21

23 Granger causality: using OLS If you regress y on lagged values of y and x and the coefficients of the lag of x are statistically significantly different from 0, then you can argue that x Granger-cause y, this is, x can be used to predict y (see Stock & Watson , Green -2008). 1. regress unemp L(1/4).unemp L(1/4).gdp Source SS df MS Number of obs = 188 F( 8, 179) = Model Prob > F = Residual R-squared = Adj R-squared = Total Root MSE =.2643 unemp Coef. Std. Err. t P> t [95% Conf. Interval] unemp L L L L gdp L L L L _cons test L1.gdp L2.gdp L3.gdp L4.gdp. ( 1) L.gdp = 0 ( 2) L2.gdp = 0 ( 3) L3.gdp = 0 ( 4) L4.gdp = 0 F( 4, 179) = 1.67 Prob > F = You cannot reject the null hypothesis that all coefficients of lag of x are equal to 0. Therefore gdp does not Granger-cause unemp. 22

24 Granger causality: using VAR The following procedure uses VAR models to estimate Granger causality using the command vargranger 1 2. quietly var unemp gdp, lags(1/4). vargranger Granger causality Wald tests Equation Excluded chi2 df Prob > chi2 unemp gdp unemp ALL gdp unemp gdp ALL The null hypothesis is var1 does not Granger-cause var2. In both cases, we cannot reject the null that each variable does not Granger-cause the other 23

25 Chow test (testing for known breaks) The Chow test allows to test whether a particular date causes a break in the regression coefficients. It is named after Gregory Chow (1960)*. Step 1. Create a dummy variable where 1 if date > break date and 0 <= break date. Below we ll test whether the first quarter of 1982 causes a break in the regression coefficients. tset datevar gen break = (datevar>tq(1981q4)) Change tq with the correct date format: tw (week), tm (monthly), tq (quarterly), th (half), ty (yearly) and the corresponding date format in the parenthesis Step 2. Create interaction terms between the lags of the independent variables and the lag of the dependent variables. We will assume lag 1 for this example (the number of lags depends on your theory/data) generate break_unemp = break*l1.unemp generate break_gdp = break*l1.gdp Step 3. Run a regression between the outcome variables (in this case unemp ) and the independent along with the interactions and the dummy for the break. reg unemp l1.unemp l1.gdp break break_unemp break_gdp Step 4. Run an F-test on the coefficients for the interactions and the dummy for the break test break break_unemp break_gdp. test break break_unemp break_gdp ( 1) break = 0 ( 2) break_unemp = 0 ( 3) break_gdp = 0 F( 3, 185) = 1.14 Prob > F = The null hypothesis is no break. If the p-value is < 0.05 reject the null in favor of the alternative that there is a break. In this example, we fail to reject the null and conclude that the first quarter of 1982 does not cause a break in the regression coefficients. * See Stock & Watson for more details 24

26 Testing for unknown breaks The Quandt likelihood ratio (QLR test Quandt,1960) or sup-wald statistic is a modified version of the Chow test used to identify break dates. The following is a modified procedure taken from Stock & Watson s companion materials to their book Introduction to Econometrics, I strongly advise to read the corresponding chapter to better understand the procedure and to check the critical values for the QLR statistic. Below we will check for breaks in a GDP per-capita series (quarterly). /* Replace the words in bold with your own variables, do not change anything else*/ /* The log file qlrtest.log will have the list for QLR statistics (use Word to read it)*/ /* See next page for a graph*/ /* STEP 1. Copy-and-paste-run the code below to a do-file, double-check the quotes (re-type them if necessary)*/ log using qlrtest.log tset datevar sum datevar local time=r(max)-r(min)+1 local i = round(`time'*.15) local f = round(`time'*.85) local var = "gdp" gen diff`var' = d.`var' gen chow`var' =. gen qlr`var' =. set more off while `i'<=(`f') { gen di = (_n > `i') cap gen d_`var'1 = di*l1.`var' cap gen d_`var'2 = di*l2.`var' cap gen d_`var'3 = di*l3.`var' cap gen d_`var'4 = di*l4.`var' qui reg diff`var' L(1/4).diff`var' di, r qui test di sca chow = r(f) cap replace chow`var' = r(f) in `i' qui reg diff`var' L(1/4).diff`var' di d_`var'1 d_`var'2 d_`var'3 d_`var'4, r qui test di d_`var'1 d_`var'2 d_`var'3 d_`var'4 sca qlr = r(f) cap replace qlr`var' = r(f) in `i' dis "`i' " %tq datevar[`i'] " " %8.3f chow " " %8.3f qlr drop di d_`var'1 d_`var'2 d_`var'3 d_`var'4 local i = `i' + 1 } NOTE: change %tq if your date variable is other than quarterly. Use %td for daily, %tm for monthly, %ty for yearly 25

27 Testing for unknown breaks: graph /* Replace the words in bold with your own variables, do not change anything else*/ /* The code will produce the graph shown in the next page*/ /* The critical value 3.66 is for q=5 (constant and four lags) and 5% significance*/ /* STEP 2. Copy-and-paste-run the code below to a do-file, double-check the quotes (re-type them if necessary)*/ sum qlr`var' local maxvalue=r(max) gen maxdate=datevar if qlr`var'==`maxvalue' local maxvalue1=round(`maxvalue',0.01) local critical=3.66 /*Replace with the appropriate critical value (see Stock & Watson)*/ sum datevar local mindate=r(min) sum maxdate local maxdate=r(max) gen break=datevar if qlr`var'>=`critical' & qlr`var'!=. dis "Below are the break dates..." list datevar qlr`var' if break!=. levelsof break, local(break1) twoway tsline qlr`var', title(testing for breaks in GDP per-capita ( )) /// xlabel(`break1', angle(90) labsize(0.9) alternate) /// yline(`critical') ytitle(qlr statistic) xtitle(time) /// ttext(`critical' `mindate' "Critical value 5% (`critical')", placement(ne)) /// ttext(`maxvalue' `maxdate' "Max QLR = `maxvalue1'", placement(e)) datevar qlrgdp q q q q q q q q q q q q q q

28 Testing for unknown breaks: graph (cont.) Testing for breaks in GDP per-capita ( ) Max QLR = 8.52 QLR statistic Critical value 5% (3.66) Time 1989q1 1989q3 1989q4 1990q1 1990q2 1990q3 1990q4 1991q1 1991q2 1991q3 1991q4 1992q1 1996q4 1997q1 27

29 Time Series: white noise White noise refers to the fact that a variable does not have autocorrelation. In Stata use the wntestq (white noise Q test) to check for autocorrelation. The null is that there is no serial correlation (type help wntestq for more details):. wntestq unemp Portmanteau test for white noise Portmanteau (Q) statistic = Prob > chi2(40) = wntestq unemp, lags(10) Portmanteau test for white noise Serial correlation Portmanteau (Q) statistic = Prob > chi2(10) = If your variable is not white noise then see the page on correlograms to see the order of the autocorrelation. 28

30 Time Series: Testing for serial correlation Breush-Godfrey and Durbin-Watson are used to test for serial correlation. The null in both tests is that there is no serial correlation (type help estat dwatson, help estat dubinalt and help estat bgodfrey for more details).. regress unempd gdp Source SS df MS Number of obs = 192 F( 1, 190) = 1.62 Model Prob > F = Residual R-squared = Adj R-squared = Total Root MSE =.3559 unempd1 Coef. Std. Err. t P> t [95% Conf. Interval] gdp _cons estat dwatson Durbin-Watson d-statistic( 2, 192) = estat durbinalt Durbin's alternative test for autocorrelation lags(p) chi2 df Prob > chi H0: no serial correlation. estat bgodfrey Breusch-Godfrey LM test for autocorrelation Serial correlation lags(p) chi2 df Prob > chi H0: no serial correlation 29

31 Time Series: Correcting for serial correlation Run a Cochrane-Orcutt regression using the prais command (type help prais for more details). prais unemp gdp, corc Iteration 0: rho = Iteration 1: rho = Iteration 2: rho = Iteration 3: rho = Iteration 4: rho = Cochrane-Orcutt AR(1) regression -- iterated estimates Source SS df MS Number of obs = 191 F( 1, 189) = 2.48 Model Prob > F = Residual R-squared = Adj R-squared = Total Root MSE = unemp Coef. Std. Err. t P> t [95% Conf. Interval] gdp _cons rho Durbin-Watson statistic (original) Durbin-Watson statistic (transformed)

32 Useful links / Recommended books DSS Online Training Section UCLA Resources to learn and use STATA DSS help-sheets for STATA Introduction to Stata (PDF), Christopher F. Baum, Boston College, USA. A 67-page description of Stata, its key features and benefits, and other useful information. STATA FAQ website Princeton DSS Libguides Books Introduction to econometrics / James H. Stock, Mark W. Watson. 2nd ed., Boston: Pearson Addison Wesley, Data analysis using regression and multilevel/hierarchical models / Andrew Gelman, Jennifer Hill. Cambridge ; New York : Cambridge University Press, Econometric analysis / William H. Greene. 6th ed., Upper Saddle River, N.J. : Prentice Hall, Designing Social Inquiry: Scientific Inference in Qualitative Research / Gary King, Robert O. Keohane, Sidney Verba, Princeton University Press, Unifying Political Methodology: The Likelihood Theory of Statistical Inference / Gary King, Cambridge University Press, 1989 Statistical Analysis: an interdisciplinary introduction to univariate & multivariate methods / Sam Kachigan, New York : Radius Press, c1986 Statistics with Stata (updated for version 9) / Lawrence Hamilton, Thomson Books/Cole,

Merge/Append using R (draft)

Merge/Append using R (draft) Oscar Torres-Reyna Data Consultant otorres@princeton.edu January, 2011 http://dss.princeton.edu/training/ Intro Merge adds variables to a dataset. This document will use merge

Cointegration and the ECM

Cointegration and the ECM Two nonstationary time series are cointegrated if they tend to move together through time. For instance, we have established that the levels of the Fed Funds rate and the 3-year

The following postestimation commands for time series are available for regress:

Title stata.com regress postestimation time series Postestimation tools for regress with time series Description Syntax for estat archlm Options for estat archlm Syntax for estat bgodfrey Options for estat

STATA Tutorial Professor Erdinç Please follow the directions once you locate the Stata software in your computer. Room 114 (Business Lab) has computers with Stata software 1.Wald Test Wald Test is used

Chapter 12: Time Series Models

Chapter 12: Time Series Models In this chapter: 1. Estimating ad hoc distributed lag & Koyck distributed lag models (UE 12.1.3) 2. Testing for serial correlation in Koyck distributed lag models (UE 12.2.2)

Introduction to Time Series Regression and Forecasting

Introduction to Time Series Regression and Forecasting (SW Chapter 14) Time series data are data collected on the same observational unit at multiple time periods Aggregate consumption and GDP for a country

Forecasting the US Dollar / Euro Exchange rate Using ARMA Models

Forecasting the US Dollar / Euro Exchange rate Using ARMA Models LIUWEI (9906360) - 1 - ABSTRACT...3 1. INTRODUCTION...4 2. DATA ANALYSIS...5 2.1 Stationary estimation...5 2.2 Dickey-Fuller Test...6 3.

Bits and Bets Information, Price Volatility, and Demand for Bitcoin

Bits and Bets Information, Price Volatility, and Demand for Bitcoin Martis Buchholz, Jess Delaney, and Joseph Warren Jeff Parker Economics 312 Spring 2012 2 I. Introduction Bitcoin is an online, digital

Econometrics I: Econometric Methods

Econometrics I: Econometric Methods Jürgen Meinecke Research School of Economics, Australian National University 24 May, 2016 Housekeeping Assignment 2 is now history The ps tute this week will go through

Failure to take the sampling scheme into account can lead to inaccurate point estimates and/or flawed estimates of the standard errors.

Analyzing Complex Survey Data: Some key issues to be aware of Richard Williams, University of Notre Dame, http://www3.nd.edu/~rwilliam/ Last revised January 24, 2015 Rather than repeat material that is

Powerful new tools for time series analysis

Christopher F Baum Boston College & DIW August 2007 hristopher F Baum ( Boston College & DIW) NASUG2007 1 / 26 Introduction This presentation discusses two recent developments in time series analysis by

Forecasting in STATA: Tools and Tricks

Forecasting in STATA: Tools and Tricks Introduction This manual is intended to be a reference guide for time series forecasting in STATA. It will be updated periodically during the semester, and will be

How Do We Test Multiple Regression Coefficients?

How Do We Test Multiple Regression Coefficients? Suppose you have constructed a multiple linear regression model and you have a specific hypothesis to test which involves more than one regression coefficient.

Marginal Effects for Continuous Variables Richard Williams, University of Notre Dame, http://www3.nd.edu/~rwilliam/ Last revised February 21, 2015

Marginal Effects for Continuous Variables Richard Williams, University of Notre Dame, http://www3.nd.edu/~rwilliam/ Last revised February 21, 2015 References: Long 1997, Long and Freese 2003 & 2006 & 2014,

ESTIMATING AVERAGE TREATMENT EFFECTS: IV AND CONTROL FUNCTIONS, II Jeff Wooldridge Michigan State University BGSE/IZA Course in Microeconometrics

ESTIMATING AVERAGE TREATMENT EFFECTS: IV AND CONTROL FUNCTIONS, II Jeff Wooldridge Michigan State University BGSE/IZA Course in Microeconometrics July 2009 1. Quantile Treatment Effects 2. Control Functions

Statistics 104 Final Project A Culture of Debt: A Study of Credit Card Spending in America TF: Kevin Rader Anonymous Students: LD, MH, IW, MY

Statistics 104 Final Project A Culture of Debt: A Study of Credit Card Spending in America TF: Kevin Rader Anonymous Students: LD, MH, IW, MY ABSTRACT: This project attempted to determine the relationship

Regression Analysis. Data Calculations Output

Regression Analysis In an attempt to find answers to questions such as those posed above, empirical labour economists use a useful tool called regression analysis. Regression analysis is essentially a

Lab 5 Linear Regression with Within-subject Correlation. Goals: Data: Use the pig data which is in wide format:

Lab 5 Linear Regression with Within-subject Correlation Goals: Data: Fit linear regression models that account for within-subject correlation using Stata. Compare weighted least square, GEE, and random

Panel Data Analysis Fixed and Random Effects using Stata (v. 4.2)

Panel Data Analysis Fixed and Random Effects using Stata (v. 4.2) Oscar Torres-Reyna otorres@princeton.edu December 2007 http://dss.princeton.edu/training/ Intro Panel data (also known as longitudinal

Lecture 16. Endogeneity & Instrumental Variable Estimation (continued)

Lecture 16. Endogeneity & Instrumental Variable Estimation (continued) Seen how endogeneity, Cov(x,u) 0, can be caused by Omitting (relevant) variables from the model Measurement Error in a right hand

The Orthogonal Response of Stock Returns to Dividend Yield and Price-to-Earnings Innovations

The Orthogonal Response of Stock Returns to Dividend Yield and Price-to-Earnings Innovations Vichet Sum School of Business and Technology, University of Maryland, Eastern Shore Kiah Hall, Suite 2117-A

Cointegration Analysis of Oil Prices and Consumer Price Index in South Africa using STATA Software

The University of Nottingham From the SelectedWorks of Mphumuzi A Sukati Mr 2013 Cointegration Analysis of Oil Prices and Consumer Price Index in South Africa using STATA Software Mphumuzi A Sukati, Mr,

Testing for serial correlation in linear panel-data models

The Stata Journal (2003) 3, Number 2, pp. 168 177 Testing for serial correlation in linear panel-data models David M. Drukker Stata Corporation Abstract. Because serial correlation in linear panel-data

Time Series Analysis

Time Series Analysis Identifying possible ARIMA models Andrés M. Alonso Carolina García-Martos Universidad Carlos III de Madrid Universidad Politécnica de Madrid June July, 2012 Alonso and García-Martos

Vector Time Series Model Representations and Analysis with XploRe

0-1 Vector Time Series Model Representations and Analysis with plore Julius Mungo CASE - Center for Applied Statistics and Economics Humboldt-Universität zu Berlin mungo@wiwi.hu-berlin.de plore MulTi Motivation

Department of Economics, Session 2012/2013. EC352 Econometric Methods. Exercises from Week 03

Department of Economics, Session 01/013 University of Essex, Autumn Term Dr Gordon Kemp EC35 Econometric Methods Exercises from Week 03 1 Problem P3.11 The following equation describes the median housing

MULTIPLE REGRESSION EXAMPLE

MULTIPLE REGRESSION EXAMPLE For a sample of n = 166 college students, the following variables were measured: Y = height X 1 = mother s height ( momheight ) X 2 = father s height ( dadheight ) X 3 = 1 if

Chapter 9: Univariate Time Series Analysis

Chapter 9: Univariate Time Series Analysis In the last chapter we discussed models with only lags of explanatory variables. These can be misleading if: 1. The dependent variable Y t depends on lags of

2. What are the theoretical and practical consequences of autocorrelation?

Lecture 10 Serial Correlation In this lecture, you will learn the following: 1. What is the nature of autocorrelation? 2. What are the theoretical and practical consequences of autocorrelation? 3. Since

Performing Unit Root Tests in EViews. Unit Root Testing

Página 1 de 12 Unit Root Testing The theory behind ARMA estimation is based on stationary time series. A series is said to be (weakly or covariance) stationary if the mean and autocovariances of the series

British Journal of Economics, Finance and Management Sciences 22 June 2016, Vol. 12 (1)

British Journal of Economics, Finance and Management Sciences 22 The Inflation-Unemployment Tradeoff in a Macroeconometric Model Camelia Ştefan The Bucharest University of Economic Studies, Bucharest,

Department of Economics Session 2012/2013. EC352 Econometric Methods. Solutions to Exercises from Week 10 + 0.0077 (0.052)

Department of Economics Session 2012/2013 University of Essex Spring Term Dr Gordon Kemp EC352 Econometric Methods Solutions to Exercises from Week 10 1 Problem 13.7 This exercise refers back to Equation

REGRESSION LINES IN STATA

REGRESSION LINES IN STATA THOMAS ELLIOTT 1. Introduction to Regression Regression analysis is about eploring linear relationships between a dependent variable and one or more independent variables. Regression

Air passenger departures forecast models A technical note

Ministry of Transport Air passenger departures forecast models A technical note By Haobo Wang Financial, Economic and Statistical Analysis Page 1 of 15 1. Introduction Sine 1999, the Ministry of Business,

August 2012 EXAMINATIONS Solution Part I

August 01 EXAMINATIONS Solution Part I (1) In a random sample of 600 eligible voters, the probability that less than 38% will be in favour of this policy is closest to (B) () In a large random sample,

TIME SERIES ANALYSIS

TIME SERIES ANALYSIS L.M. BHAR AND V.K.SHARMA Indian Agricultural Statistics Research Institute Library Avenue, New Delhi-0 02 lmb@iasri.res.in. Introduction Time series (TS) data refers to observations

Lecture 15. Endogeneity & Instrumental Variable Estimation

Lecture 15. Endogeneity & Instrumental Variable Estimation Saw that measurement error (on right hand side) means that OLS will be biased (biased toward zero) Potential solution to endogeneity instrumental

Econ 371 Problem Set #3 Answer Sheet

Econ 371 Problem Set #3 Answer Sheet 4.1 In this question, you are told that a OLS regression analysis of third grade test scores as a function of class size yields the following estimated model. T estscore

Milk Data Analysis. 1. Objective Introduction to SAS PROC MIXED Analyzing protein milk data using STATA Refit protein milk data using PROC MIXED

1. Objective Introduction to SAS PROC MIXED Analyzing protein milk data using STATA Refit protein milk data using PROC MIXED 2. Introduction to SAS PROC MIXED The MIXED procedure provides you with flexibility

TIME SERIES ANALYSIS OF CHINA S EXTERNAL DEBT COMPONENTS, FOREIGN EXCHANGE RESERVES AND ECONOMIC GROWTH RATES. Hüseyin Çetin

TIME SERIES ANALYSIS OF CHINA S EXTERNAL DEBT COMPONENTS, FOREIGN EXCHANGE RESERVES AND ECONOMIC GROWTH RATES Hüseyin Çetin Phd Business Administration Candidate Okan University Social Science Institute,

ADVANCED FORECASTING MODELS USING SAS SOFTWARE

ADVANCED FORECASTING MODELS USING SAS SOFTWARE Girish Kumar Jha IARI, Pusa, New Delhi 110 012 gjha_eco@iari.res.in 1. Transfer Function Model Univariate ARIMA models are useful for analysis and forecasting

RELATIONSHIP BETWEEN STOCK MARKET VOLATILITY AND EXCHANGE RATE: A STUDY OF KSE

RELATIONSHIP BETWEEN STOCK MARKET VOLATILITY AND EXCHANGE RATE: A STUDY OF KSE Waseem ASLAM Department of Finance and Economics, Foundation University Rawalpindi, Pakistan seem_aslam@yahoo.com Abstract:

Time Series Graphs. Model ACF PACF. White Noise All zeros All zeros. AR(p) Exponential Decay P significant lags before dropping to zero

Time Series Graphs Model ACF PACF White Noise All zeros All zeros AR(p) Exponential Decay P significant lags before dropping to zero MA(q) q significant lags before dropping to zero Exponential Decay ARMA(p,q)

Business cycles and natural gas prices

Business cycles and natural gas prices Apostolos Serletis and Asghar Shahmoradi Abstract This paper investigates the basic stylised facts of natural gas price movements using data for the period that natural

Discussion Section 4 ECON 139/239 2010 Summer Term II

Discussion Section 4 ECON 139/239 2010 Summer Term II 1. Let s use the CollegeDistance.csv data again. (a) An education advocacy group argues that, on average, a person s educational attainment would increase

TEMPORAL CAUSAL RELATIONSHIP BETWEEN STOCK MARKET CAPITALIZATION, TRADE OPENNESS AND REAL GDP: EVIDENCE FROM THAILAND

I J A B E R, Vol. 13, No. 4, (2015): 1525-1534 TEMPORAL CAUSAL RELATIONSHIP BETWEEN STOCK MARKET CAPITALIZATION, TRADE OPENNESS AND REAL GDP: EVIDENCE FROM THAILAND Komain Jiranyakul * Abstract: This study

Regression in Stata. Alicia Doyle Lynch Harvard-MIT Data Center (HMDC)

Regression in Stata Alicia Doyle Lynch Harvard-MIT Data Center (HMDC) Documents for Today Find class materials at: http://libraries.mit.edu/guides/subjects/data/ training/workshops.html Several formats

TIME SERIES ANALYSIS

TIME SERIES ANALYSIS Ramasubramanian V. I.A.S.R.I., Library Avenue, New Delhi- 110 012 ram_stat@yahoo.co.in 1. Introduction A Time Series (TS) is a sequence of observations ordered in time. Mostly these

Chapter 5: Bivariate Cointegration Analysis

Chapter 5: Bivariate Cointegration Analysis 1 Contents: Lehrstuhl für Department Empirische of Wirtschaftsforschung Empirical Research and und Econometrics Ökonometrie V. Bivariate Cointegration Analysis...

Wooldridge, Introductory Econometrics, 3d ed. Chapter 12: Serial correlation and heteroskedasticity in time series regressions

Wooldridge, Introductory Econometrics, 3d ed. Chapter 12: Serial correlation and heteroskedasticity in time series regressions What will happen if we violate the assumption that the errors are not serially

Chapter 6: Multivariate Cointegration Analysis

Chapter 6: Multivariate Cointegration Analysis 1 Contents: Lehrstuhl für Department Empirische of Wirtschaftsforschung Empirical Research and und Econometrics Ökonometrie VI. Multivariate Cointegration

Is the Forward Exchange Rate a Useful Indicator of the Future Exchange Rate?

Is the Forward Exchange Rate a Useful Indicator of the Future Exchange Rate? Emily Polito, Trinity College In the past two decades, there have been many empirical studies both in support of and opposing

Getting Started in Linear Regression using R (with some examples in Stata) (ver. 0.1-Draft)

Getting Started in Linear Regression using R (with some examples in Stata) (ver. 0.1-Draft) Oscar Torres-Reyna Data Consultant otorres@princeton.edu http://dss.princeton.edu/training/ # Dataset is in the

Univariate and Multivariate Methods PEARSON. Addison Wesley

Time Series Analysis Univariate and Multivariate Methods SECOND EDITION William W. S. Wei Department of Statistics The Fox School of Business and Management Temple University PEARSON Addison Wesley Boston

Module 6: Introduction to Time Series Forecasting

Using Statistical Data to Make Decisions Module 6: Introduction to Time Series Forecasting Titus Awokuse and Tom Ilvento, University of Delaware, College of Agriculture and Natural Resources, Food and

MODEL I: DRINK REGRESSED ON GPA & MALE, WITHOUT CENTERING

Interpreting Interaction Effects; Interaction Effects and Centering Richard Williams, University of Notre Dame, http://www3.nd.edu/~rwilliam/ Last revised February 20, 2015 Models with interaction effects

Forecasting of Paddy Production in Sri Lanka: A Time Series Analysis using ARIMA Model

Tropical Agricultural Research Vol. 24 (): 2-3 (22) Forecasting of Paddy Production in Sri Lanka: A Time Series Analysis using ARIMA Model V. Sivapathasundaram * and C. Bogahawatte Postgraduate Institute

HURDLE AND SELECTION MODELS Jeff Wooldridge Michigan State University BGSE/IZA Course in Microeconometrics July 2009

HURDLE AND SELECTION MODELS Jeff Wooldridge Michigan State University BGSE/IZA Course in Microeconometrics July 2009 1. Introduction 2. A General Formulation 3. Truncated Normal Hurdle Model 4. Lognormal

Week TSX Index 1 8480 2 8470 3 8475 4 8510 5 8500 6 8480

1) The S & P/TSX Composite Index is based on common stock prices of a group of Canadian stocks. The weekly close level of the TSX for 6 weeks are shown: Week TSX Index 1 8480 2 8470 3 8475 4 8510 5 8500

3.1 Stationary Processes and Mean Reversion

3. Univariate Time Series Models 3.1 Stationary Processes and Mean Reversion Definition 3.1: A time series y t, t = 1,..., T is called (covariance) stationary if (1) E[y t ] = µ, for all t Cov[y t, y t

Co-movements of NAFTA trade, FDI and stock markets

Co-movements of NAFTA trade, FDI and stock markets Paweł Folfas, Ph. D. Warsaw School of Economics Abstract The paper scrutinizes the causal relationship between performance of American, Canadian and Mexican

The link between unemployment and inflation using Johansen s. co-integration approach and vector error correction modelling.

Proceedings 59th ISI World Statistics Congress, 25-30 August 2013, Hong Kong (Session CPS102) p.4340 The link between unemployment and inflation using Johansen s co-integration approach and vector error

Introduction to Stata

Introduction to Stata September 23, 2014 Stata is one of a few statistical analysis programs that social scientists use. Stata is in the mid-range of how easy it is to use. Other options include SPSS,

ENDOGENOUS GROWTH MODELS AND STOCK MARKET DEVELOPMENT: EVIDENCE FROM FOUR COUNTRIES

ENDOGENOUS GROWTH MODELS AND STOCK MARKET DEVELOPMENT: EVIDENCE FROM FOUR COUNTRIES Guglielmo Maria Caporale, South Bank University London Peter G. A Howells, University of East London Alaa M. Soliman,

Lecture 13. Use and Interpretation of Dummy Variables. Stop worrying for 1 lecture and learn to appreciate the uses that dummy variables can be put to

Lecture 13. Use and Interpretation of Dummy Variables Stop worrying for 1 lecture and learn to appreciate the uses that dummy variables can be put to Using dummy variables to measure average differences

Internet Appendix to Stock Market Liquidity and the Business Cycle

Internet Appendix to Stock Market Liquidity and the Business Cycle Randi Næs, Johannes A. Skjeltorp and Bernt Arne Ødegaard This Internet appendix contains additional material to the paper Stock Market

Interaction effects and group comparisons Richard Williams, University of Notre Dame, http://www3.nd.edu/~rwilliam/ Last revised February 20, 2015

Interaction effects and group comparisons Richard Williams, University of Notre Dame, http://www3.nd.edu/~rwilliam/ Last revised February 20, 2015 Note: This handout assumes you understand factor variables,

Interaction effects between continuous variables (Optional)

Interaction effects between continuous variables (Optional) Richard Williams, University of Notre Dame, http://www.nd.edu/~rwilliam/ Last revised February 0, 05 This is a very brief overview of this somewhat

THE UNIVERSITY OF CHICAGO, Booth School of Business Business 41202, Spring Quarter 2014, Mr. Ruey S. Tsay. Solutions to Homework Assignment #2

THE UNIVERSITY OF CHICAGO, Booth School of Business Business 41202, Spring Quarter 2014, Mr. Ruey S. Tsay Solutions to Homework Assignment #2 Assignment: 1. Consumer Sentiment of the University of Michigan.

In Chapter 2, we used linear regression to describe linear relationships. The setting for this is a

Math 143 Inference on Regression 1 Review of Linear Regression In Chapter 2, we used linear regression to describe linear relationships. The setting for this is a bivariate data set (i.e., a list of cases/subjects

Lectures 8, 9 & 10. Multiple Regression Analysis

Lectures 8, 9 & 0. Multiple Regression Analysis In which you learn how to apply the principles and tests outlined in earlier lectures to more realistic models involving more than explanatory variable and

The average hotel manager recognizes the criticality of forecasting. However, most

Introduction The average hotel manager recognizes the criticality of forecasting. However, most managers are either frustrated by complex models researchers constructed or appalled by the amount of time

Business Cycles and Natural Gas Prices

Department of Economics Discussion Paper 2004-19 Business Cycles and Natural Gas Prices Apostolos Serletis Department of Economics University of Calgary Canada and Asghar Shahmoradi Department of Economics

5. Multiple regression

5. Multiple regression QBUS6840 Predictive Analytics https://www.otexts.org/fpp/5 QBUS6840 Predictive Analytics 5. Multiple regression 2/39 Outline Introduction to multiple linear regression Some useful

DETERMINANTS OF CAPITAL ADEQUACY RATIO IN SELECTED BOSNIAN BANKS

DETERMINANTS OF CAPITAL ADEQUACY RATIO IN SELECTED BOSNIAN BANKS Nađa DRECA International University of Sarajevo nadja.dreca@students.ius.edu.ba Abstract The analysis of a data set of observation for 10

Description Remarks and examples References Also see

Title stata.com vec intro Introduction to vector error-correction models Description Remarks and examples References Also see Description Stata has a suite of commands for fitting, forecasting, interpreting,

Forecasting Thai Gold Prices

1 Forecasting Thai Gold Prices Pravit Khaemasunun This paper addresses forecasting Thai gold price. Two forecasting models, namely, Multiple-Regression, and Auto-Regressive Integrated Moving Average (ARIMA),

Statistical Modelling in Stata 5: Linear Models

Statistical Modelling in Stata 5: Linear Models Mark Lunt Arthritis Research UK Centre for Excellence in Epidemiology University of Manchester 08/11/2016 Structure This Week What is a linear model? How

A Trading Strategy Based on the Lead-Lag Relationship of Spot and Futures Prices of the S&P 500

A Trading Strategy Based on the Lead-Lag Relationship of Spot and Futures Prices of the S&P 500 FE8827 Quantitative Trading Strategies 2010/11 Mini-Term 5 Nanyang Technological University Submitted By:

Testing for Granger causality between stock prices and economic growth

MPRA Munich Personal RePEc Archive Testing for Granger causality between stock prices and economic growth Pasquale Foresti 2006 Online at http://mpra.ub.uni-muenchen.de/2962/ MPRA Paper No. 2962, posted

ijcrb.com INTERDISCIPLINARY JOURNAL OF CONTEMPORARY RESEARCH IN BUSINESS AUGUST 2014 VOL 6, NO 4

RELATIONSHIP AND CAUSALITY BETWEEN INTEREST RATE AND INFLATION RATE CASE OF JORDAN Dr. Mahmoud A. Jaradat Saleh A. AI-Hhosban Al al-bayt University, Jordan ABSTRACT This study attempts to examine and study

Trade-off between Inflation, Interest and Unemployment Rate of Pakistan: A Cointegration Analysis

Pak J Commer Soc Sci Pakistan Journal of Commerce and Social Sciences 13, Vol 7 (3), 482 492 Tradeoff between Inflation, Interest and Unemployment Rate of Pakistan: A Cointegration Analysis Yasar Mahmood

The relationship between stock market parameters and interbank lending market: an empirical evidence

Magomet Yandiev Associate Professor, Department of Economics, Lomonosov Moscow State University mag2097@mail.ru Alexander Pakhalov, PG student, Department of Economics, Lomonosov Moscow State University

Econ 371 Problem Set #3 Answer Sheet

Econ 371 Problem Set #3 Answer Sheet 4.3 In this question, you are told that a OLS regression analysis of average weekly earnings yields the following estimated model. AW E = 696.7 + 9.6 Age, R 2 = 0.023,

ECON 142 SKETCH OF SOLUTIONS FOR APPLIED EXERCISE #2

University of California, Berkeley Prof. Ken Chay Department of Economics Fall Semester, 005 ECON 14 SKETCH OF SOLUTIONS FOR APPLIED EXERCISE # Question 1: a. Below are the scatter plots of hourly wages

Relationship between Commodity Prices and Exchange Rate in Light of Global Financial Crisis: Evidence from Australia

Relationship between Commodity Prices and Exchange Rate in Light of Global Financial Crisis: Evidence from Australia Omar K. M. R. Bashar and Sarkar Humayun Kabir Abstract This study seeks to identify

Time Series Analysis

Time Series Analysis hm@imm.dtu.dk Informatics and Mathematical Modelling Technical University of Denmark DK-2800 Kgs. Lyngby 1 Outline of the lecture Identification of univariate time series models, cont.:

Forecasting Using Eviews 2.0: An Overview

Forecasting Using Eviews 2.0: An Overview Some Preliminaries In what follows it will be useful to distinguish between ex post and ex ante forecasting. In terms of time series modeling, both predict values

IAPRI Quantitative Analysis Capacity Building Series. Multiple regression analysis & interpreting results

IAPRI Quantitative Analysis Capacity Building Series Multiple regression analysis & interpreting results How important is R-squared? R-squared Published in Agricultural Economics 0.45 Best article of the

Basic Statistical and Modeling Procedures Using SAS

Basic Statistical and Modeling Procedures Using SAS One-Sample Tests The statistical procedures illustrated in this handout use two datasets. The first, Pulse, has information collected in a classroom

From the help desk: Swamy s random-coefficients model

The Stata Journal (2003) 3, Number 3, pp. 302 308 From the help desk: Swamy s random-coefficients model Brian P. Poi Stata Corporation Abstract. This article discusses the Swamy (1970) random-coefficients

International Business & Economics Research Journal December 2006 Volume 5, Number 12

Performance Of Deterministic And Stochastic Trends Models In Forecasting The Behavior Of The Canadian Dollar And The Japanese Yen Against The US Dollar Arav Ouandlous, (Email: ouandlou@savstate.edu), Savannah

Sales forecasting # 2

Sales forecasting # 2 Arthur Charpentier arthur.charpentier@univ-rennes1.fr 1 Agenda Qualitative and quantitative methods, a very general introduction Series decomposition Short versus long term forecasting

Implied volatility transmissions between Thai and selected advanced stock markets

MPRA Munich Personal RePEc Archive Implied volatility transmissions between Thai and selected advanced stock markets Supachok Thakolsri and Yuthana Sethapramote and Komain Jiranyakul Public Enterprise

Rockefeller College University at Albany

Rockefeller College University at Albany PAD 705 Handout: Hypothesis Testing on Multiple Parameters In many cases we may wish to know whether two or more variables are jointly significant in a regression.

This section focuses on Chow Test and leaves general discussion on dummy variable models to other section.

Jeeshim and KUCC65 (3//008) Statistical Inferences in Linear Regression: 7 4. Tests of Structural Changes This section focuses on Chow Test and leaves general discussion on dummy variable models to other

Chapter 4: Vector Autoregressive Models

Chapter 4: Vector Autoregressive Models 1 Contents: Lehrstuhl für Department Empirische of Wirtschaftsforschung Empirical Research and und Econometrics Ökonometrie IV.1 Vector Autoregressive Models (VAR)...