Exercise 1: Regression With Time Series Data Using Microfit
Exercise 1: Regression With Time Series Data Using Microfit
Microfit Software
This assignment aims to familiarise you with basic elements of Microfit, a user-friendly but powerful
software package designed for the analysis of time series data. Manuals and software may be
purchased from Timberlake Consultants http://www.timberlake.co.uk/software/softhome.html but
since the program is available on any University-networked machine (via the Novell Network
Application Launcher) and there are multiple copies of the manual in the Hallward library, purchase
is not necessary. The manual contains many useful examples/explanations/tutorials and is extremely
well-presented. However, the programme has a very extensive help menu which is simple to use and
sufficient for most users, so you may not even need to consult the manual when conducting your
statistical analysis.
The software can be accessed from the NAL. Log on to Novell, double click on the nal icon, and
navigate through School and Departmental, followed by Economics, and then double click on
the Microfit 4.1 XP icon.
Today’s Exercise
This class makes use of real GDP data to examine the behaviour of economic growth through time.
In particular, we will construct growth rate series using GDP data, and estimate some simple time
series regressions to examine the average growth rate of US real GDP, and also the cross-country
relationship between Canadian and US growth.
The data we will use is contained in an Excel file on WebCT and the module homepage, entitled
GDP.xls. Save this file to your userspace and open the file in Excel. The two series are data on real
GDP (i.e. nominal GDP deflated by prices 1 ) for the US and Canada, observed quarterly over the
period 1973-2007 inclusive.
1 ‘Deflating’ time series data is commonplace because it allows us to evaluate monetary changes over time in
real terms (i.e. at constant prices). Although a wide number of deflators are widely available, you may need to
construct you own from an appropriate measure of inflation. To find out more about deflators, go to
http://www.hm-treasury.gov.uk/data_gdp_index.htm
1
transformations of these variables (e.g. growth rates), they will also appear here. This database area
can be returned to at any time by clicking on the Data button at the top of the screen. The
Variables button provides a quick link to a list of the series in the dataset, along with their
descriptions.
A time series plot is generated, showing the historical behaviour of the series. 2 Macro-economic
time series such as real GDP are usually analysed in log form, since this can linearise the time series,
linearise relationships between different series, and can provide useful interpretations in terms of
elasticity and growth rates.
Now take natural logs of the US real GDP series. In the Command Editor, create a new variable
LUSGDP by typing:
LUSGDP = LOG(USGDP) GO
View this new series in the dataset by clicking on Data, then return to the Command Editor by
clicking on Process and plot the log of US real GDP:
PLOT LUSGDP GO
The growth of US real GDP can now be constructed by taking first differences of the log real GDP
series. In the Command Editor the growth rate series can be created as follows:
USGRW = LUSGDP – LUSGDP(–1) GO
Plot the growth rate series and observe its behaviour over time. We can also obtain summary
statistics for this series by using the COR command in the Command Editor:
COR USGRW GO
Now repeat the above analysis for the Canadian real GDP data, i.e. (i) plot the raw series, (ii) take
logs and plot the logged data, and (iii) create and examine the growth rate series.
2
Whenever you enter data (especially if you have typed it in) always check it carefully and plot it to ensure
that it looks sensible and that obvious errors are not present (e.g. the decimal place has been placed
correctly!). It is vital to check your data is what you think it is, and also gives you the opportunity to get
familiar with its important characteristics, features that we will want to model in due course. If you do not
known what the features of your data are, you are not going to be to develop a particularly good model of
them.
2
Saving Results, Data and Graphs
The dataset and output (results and graphs) produced by Microfit can be saved and then imported
into other software, e.g. Word.
To save results, first start with the desired results window open on the screen. For example, to save
the summary statistics of the US growth series, first get the results up by typing:
COR USGRW GO
Now click on the second icon: Save to a new results file and give the file a name. The file that is
created is a simple text file so can be opened in Word and copied/edited. Alternatively, the text in
the results window can be copied to the clipboard and pasted into a Word document directly.
To save the current dataset, click on File then Save As… in the usual way. This saves all the data in
a Microfit .fit file which can subsequently be reopened in Microfit. To save as text, go to the
Command Editor and type:
LIST GO
The data is displayed as a results file which can then be either saved as a text/output file or copied
and pasted into a Word document.
To save graphs, again start with the relevant graph on the screen, e.g. type:
PLOT USGRW GO
Now click on the second icon: Image to file and give the file a name, choosing either the bitmap
format (.bmp extension) or the Windows metafile format (.wmf extension). Either of these formats
can be imported into Word as a picture. Alternatively, if you do not need to save the file but just
import it directly into Word, you can click on the fourth icon: Copy graph to clipboard and simply
paste it into an open Word document.
Estimation by ordinary least squares can then be done by clicking on Single to enter the single
equation estimation part of Microfit, and then entering the dependent variable followed by the
constant and trend term, i.e. typing: 3
LUSGDP C T Start
3You can use the start of period and end of period drop-down menus to change the sample size. Note that
when you do this you are asked to specify the number of observations for Chow’s (predictive failure) test of
parameter stability. Ignore this (specify 0) unless you want this test to be conducted.
3
Since the dependent variable is measured in logs, the estimated coefficient on the trend term gives
an estimate of the average quarterly growth rate of US real GDP. As can be seen, US real GDP has
grown at 0.79% per quarter on average over this period, i.e. roughly 3% per annum.
The fitted values from this regression represent the estimated trend line, and these can be obtained
by closing the regression results window and then selected option 3 from the Post Regression
Menu. Plot the actual and fitted values together to see the estimated trend line super-imposed on
the data.
We will now conduct a simple analysis of the cross-country relationship between real GDP growth
in Canada and the US. First, plot the two series on the same graph by typing:
PLOT CAGRW USGRW GO
Observe that the two series broadly move together, suggesting that the growth rates in the two
countries are related over time, as we might expect.
To examine this relationship more formally, we start by estimating a static regression. Now
consider regressing Canadian real GDP growth (yt) on a constant and US real GDP growth (xt), i.e.
estimating the regression:
y t = β 1 + β 2 xt + u t
In the single equation estimation part of Microfit, enter the dependent variable followed by the
constant and the explanatory variable:
CAGRW C USGRW Start
Estimates of the regression coefficients β1 and β2 are reported, along with their standard errors, plus
t-ratios for testing significance of the relevant coefficient estimate.
In our example, we can see that the t-ratio is very large and that the null is rejected at practically any
significance level, so we can conclude that there is a highly significant relationship between Canadian
4
real GDP growth and US real GDP growth. Since the variables are growth rates, we can interpret
the estimated regression coefficient as indicating that a 1% change in US growth is associated with a
0.45% change in Canadian growth.
The goodness-of-fit measures R2 and R 2 are also given in the Microfit output. In our example, the
measures are quite low, suggesting a relatively poor fit. We can also obtain the fitted values and the
residuals from the regression by closing the regression results window and then selecting option 3
from the Post Regression Menu.
In addition to the simple t-ratios for testing the null that a particular coefficient is equal to zero,
Microfit also allows more general tests of linear restrictions. In our simple example, suppose we wish
to test whether there is a one-for-one relationship between the growth rates of US and Canadian real
GDP, i.e.:
H0 : β2 = 1
H1 : β 2 ≠ 1
in our regression. From the Post Regression Menu, select option 2 (hypothesis testing menu)
followed by option 7 (Wald test of linear/nonlinear restricions). The coefficients in the regression
are assigned the labels A1, A2, etc. and the null hypothesis must be entered in the box (if more than
one restriction is being tested, separate the restrictions with semi-colons). For our test, type:
A2 = 1 Ok
The Wald test is computed and reported in the next window, along with the distribution from which
the critical values are obtained, here χ2(1), and the prob value. The prob value is very small, so we
clearly reject the null hypothesis at conventional significance levels.
The test we have just conducted could actually be done using a t-test, given that we are testing a
single restriction on one coefficient. The information needed for computing the test statistic is
provided in the regression results output, so now work out the test statistic from your results and
write down the distribution from which you would obtain the critical value.
Seasonal Data
Finally, note that many economic time series exhibit seasonal variation, i.e. if data is collected at
quarterly or monthly frequencies, seasonal patterns are typically observed in the data, e.g. consumer
spending is very high in the fourth quarter each year due to Christmas expenditures. This seasonality
needs to be accounted for in some way. Typically, most data made available by government
statistical agencies are seasonally adjusted prior to publication, so usually this is not an issue (e.g. the
data examined in this exercise is seasonally adjusted). Sometimes, however, only the raw unadjusted
data are available. In such cases, the seasonality can be accounted for by either (i) incorporating
seasonal dummy variables as additional explanatory variables in the regression (these can be created
using the Seasonal 1 button in the Command Editor), or (ii) by removing the seasonality through a
seasonal adjustment procedure. A program that conducts the US-standard X-12-ARIMA seasonal
adjustment procedure can be downloaded from http://www.census.gov/srd/www/x12a/. Note
that, with quarterly data, if a constant and four seasonal dummies are included in a regression, there
will be perfect multi-collinearity, so the constant or one of the seasonal dummies should be left out!