Introduction to Microfit 4for Windows
Microfit 4 for Windows is an econometrics computer package. Its purpose is the estimation and testing of regression equations. The Windows version of this package is the successor to three earlier DOS versions, Microfit 286, Microfit 386 and Microfit 4.
The package takes a lot of the drudgery out of econometrics and should be used regularly as part of the course. In particular, the various econometrics textbooks provide exercises at the end of each chapter, which can easily be completed using Microfit. Only by using the package will it become familiar.
In the next 3 or 4 sessions Microfit will be introduced by example. A number of regression equations will be estimated. The fist and most detailed example will be described in these notes, and involves estimating a simple bivariate regression. In the initial stages of the course, the examples can be used as templates for the computing components of your own work.
Obtaining estimates of a regression equation using Microfit is easy. So easy that it is possible to forget that the primary concern is economic theory. An econometric model is set up to test economic theory against real data. Microfit is simply a tool used to estimate the parameters of a chosen econometrics model and to establish the reliability of the estimates.
There are a large number of facilities in Microfit, which are beyond the scope of the course. However, an understanding of the main facilities will provide a basis for independent investigation of the more complicated features of the package. Interpreting the results, testing assumptions and correcting for violations of those assumptions are the topics that will be covered in the econometrics course.
Data saved to the hard disk of the machines may be deleted without warning. Save output from Microfit to 3.5” High-Density floppy disks.
The example is taken from Basic Econometrics, 3rd edition, D. Gujarati, McGraw Hill Int, 1995, question 3.17 page 90 and investigates the relationship between the level of unemployment and the quit rate.
The first step is to state the hypothesis being tested. The quit rate (employees voluntarily leaving their jobs) is expected to be inversely related to the level of unemployment in the country as a whole. If the level of unemployment is high, employees will be less certain of finding alternative employment, encouraging them to stay in their existing jobs. Conversely, if the level of unemployment is low, alternative employment will be more readily available, and the temptation to leave existing jobs greater.
Secondly, an econometric model of the hypothesis is needed. Assuming the quit rate is linearly related to the employment rate, a single equation econometric model describing the hypothesis would be as follows:
=++
where
the dependent variable Y=quit rate and
the independent variable X=unemployment rate.
and the disturbance term u makes the relationship stochastic rather than deterministic.
The model is of the population; i.e. it describes the relationship that theory suggests holds between the quit rate and the unemployment rate in the population as a whole. It may also referred to as the population regression function (PRF). The disturbance term, u, introduces a random element into the equation, and can be seen as measuring the effect of variables not include specifically in the equation, accounting for measurement error or for the unpredictable factor in human actions.
The next step is to use the available date to obtain estimates of and . A sample regression function is used to estimate the population regression function.
Y=++
Where is an estimate of ; is an estimate of ; and e is the residual term.
For the bivariate case the estimates of the coefficients of the regression and their standard errors are given by the following equations:
The estimate of the slope coefficient, , is expressed in a number of equivalent forms.
or or in deviation form
In deviation form, and
The standard error of the slope coefficient, :
The numerator, lower case sigma, is the constant standard deviation of the disturbance term and the denominator is in deviation form.
The estimate of the intercept term, , is as follows:
and its standard error:
The constant standard deviation of the disturbance term, lower case sigma, is outside of the square root and the denominator is in deviation form.
Gujarati provides the following data to obtain our estimates
YEAR / Quit Rate per 100 employees / Unemployment Rate (%)1960 / 1.3 / 6.2
1961 / 1.2 / 7.8
1962 / 1.4 / 5.8
1963 / 1.4 / 5.7
1964 / 1.5 / 5.0
1965 / 1.9 / 4.0
1966 / 2.6 / 3.2
1967 / 2.3 / 3.6
1968 / 2.5 / 3.3
1969 / 2.7 / 3.3
1970 / 2.1 / 5.6
1971 / 1.8 / 6.8
1972 / 2.2 / 5.6
Source: Manpower Report of the President, 1973,
Microfit can be used to complete the calculation.
1) Starting Microfit.
Within the Economics program group double click the Microfit icon:
The following initial screen will appear.
2) Data Entry
The first task in Microfit is to enter the data. Without any data the package cannot estimate an equation. Note that large portions of the opening screen are gray rather than black, indicating that those facilities are not available. Most become available once the data has been entered.
There are 5 methods of entering data: from the keyboard, by loading an already existing Microfit data file, by loading a CSV (comma separated variables) file, as could be created by Excel, by loading an AREMOS file or by using copy and paste from the clipboard. For this example data will be entered from the keyboard. Later examples will cover the other methods of entering data.
Microfit requires the dimensions of the data to be entered before any numbers. The dimensions consist of the frequency of the data (Monthly, Quarterly, Half Yearly, Annual or Undated), the period covered (e.g. 1960 to 1990) and the number of variables.
To enter a new dataset make the following selection from the menu bar:
File/Open
A dialogue box appears for the dimensions of the dataset. The dimensions are entered by clicking the relevant radio buttons and filling in the boxes. The employment data is annual, from 1960 to 1972 and there are two variables, the quit rate and the unemployment rate. The completed dialogue box is as follows.
2.1 The variable Window – Variable Names and Descriptions.
Having entered the dimensions of the data, the variable window appears. Variable names and descriptions are entered into the variable window. Once the data has been entered, the Variable Window is available throughout the Microfit session and is accessed by clicking the Variables button on the main screen.
With only two variables it might seem superfluous to have a window devoted to keeping track of the variables, but in regression analysis it is common to create a large number of variables and this window will be used frequently.
Microfit enters default names X1, X2…for the variables in the dataset. Change these for meaningful names. Names are not case sensitive, can be a maximum of 9 characters long, and cannot begin with a number or symbol. As with all computer packages, names of commands and reserved words will be rejected. A short description of the variable is a useful aid to memory. The description may be up to 80 characters. Be sure to enter the units the variable is measured in. For the example the dialogue box is as follows:
Press the Go button to continue.
2.2 The Data Editor Window.
Microfit uses the dimensions entered earlier to create a grid for data entry: a column
For each variable and a row for each frequency of the data. Enter the data from the keyboard, using the arrow keys to move down the columns. Pressing enter will not move to the next cell. For our example, the completed data window is as follows:
Press theClosebutton to continue and control will pass to the Command Editor Window.
3) Saving Data.
Entering data is tedious. Having entered the data, save it immediately to avoid inadvertently losing the file and having to re-enter the data. To save the data select File/Save from the menu bar and a standard windows dialogue box for saving files appears.
The file can be saved in Microfit, ASCII, CSV or AREMOS format.
Microfit format create a file with suffix. FIT. The file contains the data and information on the variables, such as name and description. It does not contain the results of any regressions run or graphs created. It cannot be read by any package other than Microfit.
American Standard Code for Information Interchange (ASCII) is the lowest common denominator between computer packages. Almost all computer packages will read ASCII files, but some manipulation may be necessary to ensure they are read correctly.
Comma Separated Variables (CSV) files are used to read data between spreadsheets. As the name suggests, commas are used to separate fields. This is the best format to use if moving the data from Microfit into Excel.
Aremos (TSD) files are database files for the Aremos package.
To change the type of file, click the arrow to the right of the Save File as Type: box and the file types listed above will appear.
For the example, save the file to a floppy disk as a Microfit file with the name QUITUNEM, as in the dialogue box below. If omitted, the suffix. FIT will be attached automatically.
Microfit provides the opportunity to save a subset of the dataset. To save a subset adjust the first and last observation dates using the arrow keys to the left of the relevant boxes. In most cases the entire dataset is saved. Save the entire dataset for this example by leaving the default start and end dates and clicking the OK button.
Having saved the data, move to the command editor by clicking the Process button at the top of the screen or by pressing the Close button to the right of the screen. Close completes the process and moves to the next step. Go completes the process but the package does not move to another screen but stays in the data window.
4) The Command Editor/Window.
The command window is used to transform variables, add variables, graph data and complete preliminary data analysis. With practice the range of features will become familiar. In the first instance, a brief description of the screen will be useful.
As with all windows applications, the top line contains the control icon, the title bar with the name of the current dataset, and the minimize and maximize buttons. Below this is the Menu Bar. Many of the routines available through the menu bar are available directly from buttons on the window.
Below the Menu Bar is the button bar. The first 5 buttons, each leading to a different window. The Variables button leads to the Variable Window in which you can change the names of variables and/or their description. The Data button moves to the data processing window where it is possible to edit the data series already entered. The Processing button leads to the Command Window, used for data transformation and graphing. The Single Button leads to the window used to estimate a single regression equation. The Multi button leads to the window used to estimate a system of regression equations.
The next two buttons are used to open a new dataset and to save the current dataset. N.B. In the process of running a regression it is likely that variables will be transformed and new variables created. These new variables are not saved to the dataset unless explicitly done so, i.e. until the second of the two buttons is pressed.
The grayed buttons are not available at this time, but are to copy, cut and paste information to the clipboard. The final button closes Microfit.
There is a further bar below the button, containing three buttons used for saving the contents of the command editor, loading a previously saved set of functions/commands into the command editor and for clearing the command editor. The contents of the command window can be saved to a file and recalled later using these buttons. The file is given the extension. EQU. Next to the buttons is a description of the dimensions of the current dataset.
Below this is the actual command editor, into which functions and commands can be entered. To the right of the command editor are two pull down lists, one to all available buttons, the second of all available commands. Each function and command has a help entry describing its use. Above the pull down lists are three buttons, the GO button processes the entries in the command editor, the Help button provides help and the BATCH button is for processing batch files, lists of commands.
At the bottom of the screen are 5 buttons used to create new variables. One to create an intercept term, one to create a time trend, and the final three to create various types of seasonal dummy variables.
4.1 Entering Commands and Functions into the Command Editor.
A single or more commands may be entered into the command editor. Each command must be separated by a semi-colon (;). The GO button processes all commands in the command editor. Clear the command editor if the commands have been run successfully or they will be run again.
To create a new variable simply enter the variable name, followed by an equal sign with an expression to the right. The expression can be constant, a variable, a function or any combination of these. The mathematical order of operation is followed, and can be changed using parenthesis(). Once a variable has been created, its name and description is listed in the Variable Window and the actual data appears in a column in the Data Windows. It is not however saved to the file on disk until explicitly done so either by using the File/Save menu bar option or by clicking on the save button on the first toolbar.
A few examples should make this clear. Try the following mathematical operators, either individually or by separating the commands by semi-colons and running all the examples at once:
Operator / Function / Example^ / Raising to a Power / quitsq=quit^2
* / Multiplication / quit2=2*quit
/ / Division / quithalf=quit/2
+ / Addition / quitquit=quit+quit
- / Subtraction / quit0=quitquit-quit2
Check the Variable and Data Windows and then clear the command editor.
Transformations are frequently used in Econometrics to overcome weaknesses in the assumptions. Amongst the most common transformations is taking the natural log of a variable. The inverse of the natural log of a number is raising e to the power of the log. Microfit provides the functions LOG and EXP. Try the following.
logquit=log(quit);
equit=exp(quit);
quit3=exp(log(quit));
Check the Variable and Data Windows and then clear the command editor.
Microfit provides the function SQRT to take the square root of a number.
quitroot=sqrt (quit);
quit3=sqrt (quit^2);
Check the Variable and Data Windows and then clear the command editor.
To find other roots, raise the variable to the power of a fraction. Try the following:
quitr3=quit^(1/3)
quit4=(quit^3)^(1/3)
Check the Variable and Data Windows and the clear the command editor.
4.3 Creating a Unitary Variable
Microfit uses matrix manipulation to calculate a vector of the Ordinary Least Squares estimated coefficients.
OLS Estimates Vector=
y is the vector of values of the dependent variable, in this case the quit rate. X is the data matrix, with a vector of data for each coefficient to be estimated. Data has been entered for the unemployment rate but no data has been entered for the intercept term. In order for Microfit to estimate the intercept term a unitary variable is required, i.e. a variable with the value 1 for each observation, a data vector of 1’s. The population regression function could have been written as follows:
where for all values of i.
The variable has to be created explicitly, its value being 1 for each of the observations.
There are two ways of creating a unitary variable from the Command Window. The first is simply to create a variable and set it equal to a constant.
int=1
Check the Variable and Data Windows and then clear the command editor.
The second is to use the button on the bottom left of the screen marked Constant. A prompt appears for a name for the variable. Simply enter a name and click OK. Check the Variable and Data Windows to make sure it has worked.
4.4 Graphing.
Graphing is an essential tool in econometrics. A graph can highlight the relationship between variables, uncover any structural breaks or drastic changes in trend, and pinpoint the existence of outliers and mistakes in data entry. It is good practice to use graphs to get a feel for the data and to learn from the data.
To obtain a graph enter one of the graphing commands in the Command Window. The graph will then appear in its own window, from where it can be edited, printed, and saved in various formats.
The graphing commands in Microfit are PLOT, XPLOT, SCATTER, and HIST.
Try the following:
The plot command plots one or a number of variables against time.
PLOT QUIT
PLOT QUIT UNEMP
Line graph of the Quit rate and Unemployment rate against time. Note the inverse pattern.
The xplot command plots up to three variables against another. This command needs at least two variables as arguments. The variable against which the others are to be plotted, the X value, must come last in the list.