Beruflich Dokumente
Kultur Dokumente
Hashem Pesaran
Dr Shaun Vahey
2000
INMFW.DOC
Paper 5, Prelim.
read data
transform variables
produce graphs
run univariate regressions, and
carry out hypothesis testing.
This handout should be read in conjunction with the manual of the package, Working with
Microfit 4.0: Interactive Econometric Analysis (Windows Version).
1. Introduction to Microfit
This document has been prepared using the capability of Microfit to produce graphs and tables
that can be imported directly into most word processing packages (here Microsoft Word).
Whenever graphs or tables are produced, Microfit gives the option to save the output to the
clipboard for subsequent pasting into documents. When importing tables into a word
processing package it is best to use a non-scaleable font (such as Courier) .This maintains the
alignment of columns from Microfit output. Graphs and tables can also be saved as files. There
are a variety of formats available to save graphs as files, including bitmap, or as a Microfit
graph file for subsequent use in Microfit.
Microfit has extensive help facilities to guide you through the program. Under the Options
menu you can toggle on or off Bubble help which, when on, displays brief explanations of the
functions available as the mouse moves over the screen. There are also extensive explanatory
notes available via the Help menu. This includes an overview and guidance for using Microfit,
comprehensive explanations of the commands available and their use, and also detailed
explanatory notes for the regression techniques available in the package, including references to
further readings where relevant. Furthermore, general guidelines to help you make the best use
of the options are available throughout the package. The manual Working with Microfit 4.0 also
has comprehensive explanations, guidance and tutorial lessons to help you become familiar
with econometric techniques.
Microfit can accept data of many different types, including ASCII files, CSV files and
AREMOS files. The following examples demonstrate how to input Excel and Microfit data
files. (A complete description of Microfits options for inputting and saving data files is
contained in Chapter 3 of Working with Microfit 4.0.)
2. Data Transformations
When Microfit has read the data successfully, the following screen opens:
You now have the opportunity to make any required transformations of the data before
beginning the econometric analysis. Microfits options for data processing and preliminary data
analysis are described in detail in Chapter 4 of Working with Microfit 4.0. There are also a
number of commands available in the FUNCTIONS and COMMANDS menus that calculate
basic statistics such as the mean, the standard deviation or correlation coefficients, and produce
graphs of the data series. The screen also contains information on the selected sample, the
number of observations and the number of variables that you have imported into Microfit. The
editor window can now be used to create new variables.
The general formula to transform variables is:
new variable = function of old variable(s)
Introduction to Microfit 4.0 for Windows
For instance, to generate the (natural) logarithms of the variables P, PF and PH type:
LP = log(P); LPF = log(PF); LPH = log(PH)
and click Go to process. To check on the variables you have created you can click on the
Variables button. This opens a screen that lists the variable names and any descriptions. To
close this screen click on the Variables button again. Alternatively, by clicking Close on the
VARIABLES window itself, you can hold the variable list as an icon that can be positioned
conveniently on your screen. Double clicking on this icon then reopens the VARIABLES
window to allow you to keep track of your variables and descriptions.
As another example, suppose you wish to create the percentage rate of change of the aggregate
price level. First delete the current contents of the editor window (use Bubble help to identify
the button Delete current contents of editor window), and then type:
RATEP = 100*(P-P(-1))/P(-1)
where (-1) immediately after the variable denotes (and is understood by Microfit to mean) the
value of the variable lagged by one period. To process, click Go. Lead variables can likewise
be declared by (+1) in Microfit.
Alternatively, RATEP can be generated automatically by using the function rate. Type:
RATEP = rate(P)
and click on Go to process.
If you wish to generate fixed variables such as a constant, seasonal dummies, or deterministic
trends, you can use the buttons at the base of the screen to do so.
To create a constant, click on Constant and give (type) a name to the constant that you would
like to generate, for example CONST. Microfit can also generate different types of seasonal
dummies. To create simple 0-1 dummies select the Seasonal (1) button at the base of the
screen. Of course, these are usually used with monthly or quarterly time series data.
To generate period or group-specific dummy variables, use the sample function to mark the
periods/groups and then create the required dummies. For example, type:
sample 1948 1988;
DUM1 = 0;
DUM2 = 0;
DUM2 = 1;
and then click Go. The variables DUM1 and DUM2 now contain zeros except in the case of
observations for the relevant periods where they contain ones. To see exactly what these
variables look like, list them by clicking on the Data button.
If you are performing a number of complex data transformations you should use a batch file
(constructed with the DOS editor or Microsoft Wordpad). The file M:AIDS.BAT contains a
number of transformations useful for estimating Almost Ideal Demand Systems. Click on the
batch button and select the appropriate file to run the batch job. See Working with Microfit
4.0, Section 4.4.3 p54 for details.
PLOT of LP
1.0
0.8
0.6
0.4
LP
0.2
0.0
-0.2
-0.4
-0.6
1960
1965
1970
1975
1980
1985
Years
Microfit has extensive graphics editing facilities that can be accessed by clicking on the Show
Graph Toolbar button on the toolbar. There are numerous options for adjusting the
background, colour, axes, style, titles, etc. of your graph. Each option in the GRAPH
CONTROL menu that opens when you click the Show Graph Toolbar button has its own
property page; click the appropriate page tab to view it. Each property page contains a number
of options; use the appropriate buttons, checkboxes, etc. to make the changes you desire. (More
details on how to alter the display of graphs are provided in Section 5.2.1 of Working with
Microfit 4.0 p64).
Another useful command which helps you to understand whether there is correlation between
two series is the scatter command. This command plots one series against another. For
instance, to investigate graphically the extent of any correlation between aggregate income
(AGGY) and total expenditure (E), clear the editor window, type:
scatter AGGY E
and then click Go to process.
Scatter plot of AGGY on E
400000
300000
AGGY
200000
100000
0
0
50000
100000
150000
200000
250000
300000
As you can see from this graph, AGGY and E are almost perfectly (positively) correlated.
Suppose that the dependent variable is food expenditure as a share of total expenditure on all
commodities, WF. The constant is INPT and the other explanatory variables are the (natural)
logs of the commodity prices, LPF, LPH, LPC, LPM, LPE, LPO, and the (natural) log of real
income, LRY. Type in the editor box:
WF INPT LPF LPH LPC LPM LPE LPO LRY
and then click on the Start button. You will see the following table.
Ordinary Least Squares Estimation
*******************************************************************************
Dependent variable is WF
29 observations used for estimation from 1960 to 1988
*******************************************************************************
Regressor
Coefficient
Standard Error
T-Ratio[Prob]
INPT
.29146
.0018291
159.3440[.000]
LPF
.20056
.046063
4.3541[.000]
LPH
-.018577
.018647
-.99621[.330]
LPC
-.035653
.037559
-.94926[.353]
LPM
.018776
.029345
.63983[.529]
LPE
-.088343
.041091
-2.1499[.043]
LPO
-.084531
.034710
-2.4354[.024]
LRY
-.13313
.017917
-7.4305[.000]
*******************************************************************************
R-Squared
.99714
R-Bar-Squared
.99619
S.E. of Regression
.0030982
F-stat.
F( 7, 21)
1047.5[.000]
Mean of Dependent Variable
.27396
S.D. of Dependent Variable
.050210
Residual Sum of Squares
.2016E-3
Equation Log-likelihood
131.0618
Akaike Info. Criterion
123.0618
Schwarz Bayesian Criterion
117.5926
DW-statistic
1.5040
*******************************************************************************
Diagnostic Tests
*******************************************************************************
*
Test Statistics *
LM Version
*
F Version
*
*******************************************************************************
*
*
*
*
* A:Serial Correlation*CHSQ(
1)=
1.5897[.207]*F(
1, 20)=
1.1599[.294]*
*
*
*
*
* B:Functional Form
*CHSQ(
1)=
4.0839[.043]*F(
1, 20)=
3.2781[.085]*
*
*
*
*
* C:Normality
*CHSQ(
2)=
.50066[.779]*
Not applicable
*
*
*
*
*
* D:Heteroscedasticity*CHSQ(
1)=
3.8035[.051]*F(
1, 27)=
4.0758[.054]*
*******************************************************************************
A:Lagrange multiplier test of residual serial correlation
B:Ramsey's RESET test using the square of the fitted values
C:Based on a test of skewness and kurtosis of residuals
D:Based on the regression of squared residuals on squared fitted values
The first part of the table gives estimates of the regression coefficients, the R-Squared and the
standard error of the regression. The second part contains a variety of residual diagnostic
statistics (such as the LM-statistic for serial correlation, a test for heteroscedasticity, etc.).
5. Hypothesis Testing
The significance of each individual regressor in explaining the variance of the dependent
variable can be tested using the reported t-ratios for the coefficient of the regressors, or by
checking the probability value reported in the square brackets. The latter gives the probability
of falsely assuming that the coefficient of the regressor in question is equal to zero. For
example, the t-ratio of the coefficient of the LPH variable is equal to -.99621, with a probability
value of 0.330, implying that this variable is significant only at the 33 percent level.
Apart from t-tests, Microfit offers a variety of test statistics for checking economic hypotheses
of interest. These options can be reached by clicking Close in the results window. Then select
option 2 (Move to Hypothesis Testing Menu) of the POST REGRESSION MENU that
appears and click Ok. The HYPOTHESIS TESTING MENU that appears has a variety of
options. For example, if you would like to test whether the above equation is homogeneous in
prices, choose option 7 (Wald test of linear/nonlinear restrictions) of the menu, click Ok,
then type the restrictions:
A2+A3+A4+A5+A6+A7=0
in the editor box and click Ok. Microfit then computes the Wald statistic for testing these
restrictions. The results on your screen should match the following table:
Wald test of restriction(s) imposed on parameters
*******************************************************************************
Based on OLS regression of WF on:
INPT
LPF
LPH
LPC
LPM
LPE
LPO
LRY
29 observations used for estimation from 1960 to 1988
*******************************************************************************
Coefficients A1 to A8 are assigned to the above regressors respectively.
List of restriction(s) for the Wald test:
a2+a3+a4+a5+a6+a7=0
*******************************************************************************
Wald Statistic
CHSQ( 1)=
.21835[.640]
*******************************************************************************
In this case the restriction is rejected at any reasonable significance level. Another useful
hypothesis to test is the joint hypothesis that a number of regressors are jointly statistically
insignificant. Suppose in the present example you wish to test the joint significance of the price
variables LPF and LPH.
To carry out this test, close the results window for the Wald test, select option 5 (Variable
Deletion Test (OLS & IV)) of the HYPOTHESIS TESTING MENU that appears, click Ok,
then type the variables:
LPF LPH
10
in the editor box that appears and click Ok. Microfit then estimates the regression without these
variables. The results on your screen should match the following table:
Variable Deletion Test (OLS case)
*******************************************************************************
Dependent variable is WF
List of the variables deleted from the regression:
LPF
LPH
29 observations used for estimation from 1960 to 1988
*******************************************************************************
Regressor
Coefficient
Standard Error
T-Ratio[Prob]
INPT
.28942
.0020363
142.1282[.000]
LPC
-.046541
.049087
-.94813[.353]
LPM
.045445
.035904
1.2657[.218]
LPE
.0087348
.033328
.26209[.796]
LPO
-.075422
.044884
-1.6804[.106]
LRY
-.10925
.022223
-4.9163[.000]
*******************************************************************************
Joint test of zero restrictions on the coefficients of deleted variables:
Lagrange Multiplier Statistic
CHSQ( 2)= 13.8032[.001]
Likelihood Ratio Statistic
CHSQ( 2)= 18.7402[.000]
F Statistic
F( 2, 21)=
9.5371[.001]
*******************************************************************************
At the bottom of these results, Microfit reports three test statistics which allow you to check the
joint significance of the excluded variables from the regression: the Lagrange multiplier
statistic, the Likelihood ratio statistic, and the F-statistic. These three test statistics are
asymptotically (that is, for large enough samples) equivalent but can differ in small samples.
The probability values for all these tests are very small, suggesting that the excluded variables
are statistically significant.
11