Installing and Using the Dummy Dependent Variable Excel Add-in

advertisement
Installing and Using the Dummy Dependent Variable Excel Add-in
Software for
Introductory Econometrics
By
Humberto Barreto and Frank M. Howland
hbarreto@depauw.edu and howlandf@wabash.edu
(765) 658-4531 and (765) 361-6317
WARNING:
This software was written and designed for teaching purposes. It has been tested
on several examples but not on a wide variety of data sets. For mission-critical
projects, always check the results with full-fledged statistical programs.
This document assumes Excel’s Solver has been successfully installed and that the user is
familiar with Solver. If not, please see the document Solver.doc before proceeding.
The Dummy Dependent Variable add-in is DDV.xla (from the CD-ROM or zipped archive, it is in
BasicTools\ExcelAddIns\DummyDepVar).
PURPOSE OF THIS DOCUMENT
This document describes how to install and use the Excel add-in DDV.xla in order to estimate
Probit or Logit models via ML or NLLS. In addition to coefficient estimates, the add-in reports
estimated SEs and draws charts of predicted probabilities.
DDV v DDVGN
We have two Excel add-ins for dummy dependent variable models: DDV.xla and DDVGN.xla.
DDV.xla’s primary virtue is as a teaching device. It allows the student to see the formulas and
use Excel’s Solver to find the optimal solution (either NLLS or ML).
The Gauss-Newton Dummy Dependent Variable add-in, DDVGN.xla, does not use Excel’s
Solver and has more features. Learn more about DDVGN.xla by reading DDVGN.doc in the
Basic Tools\ExcelAddins\DDVGaussNewton folder.
687317324
Page 1 of 6
INSTALLING AND LOADING
Microsoft offers the following description of an Excel add-in:
Add-ins are programs that add optional commands and features to Microsoft
Excel. Before you can use an add-in, you must install it on your computer and
then load it in Microsoft Excel. Add-ins (*.xla files) are installed by default in the
Library folder in the Microsoft Excel folder. Loading an add-in makes the feature
available in Microsoft Excel and adds any associated commands to the
appropriate menus. [Microsoft Excel Help, add-ins, overview]
Thus, to install an add-in is to have an add-in file (*.xla) in the Library folder of your hard drive.
To load it, you must complete an additional step using the Add-In Manager. Fortunately, you
need to do this only once.
Step 1: Installing the DDV.xla file
If you are accessing the DDV.xla add-in from a CD-ROM, place the CD in your computer. If
accessing from a network server, make sure you can read from the appropriate network drive.
If you do not have CD-ROM or network access to the DDV.xla add-in, download it by visiting
<www.wabash.edu/econometrics>. Download the DDV.xla file directly to the appropriate addins folder on your hard drive (usually, C:/Program Files/MicrosoftOffice/Office/Library) or
move it there after downloading to your hard drive.
Step 2: Loading The DDV.xla add-in
Once the DDV.xla file is accessible, launch Excel and use the Add-In Manager to load the
Dummy Dependent Variable Analysis add-in.
From Excel 2010, click the File menu, then Options, then Add-ins. Excel 2007 is similar, except
you click the Office button, then Excel Options, then Add-ins. In previous versions of Excel,
click the Tools menu, and then click Add-ins.
This screenshot
is old. Newer
versions of
Excel have a
similar Add-in
Manager dialog
box.
687317324
Page 2 of 6
If the Dummy Dep Var Analysis is not listed in the Add-Ins scroll box, click the Browse (or
Select) button, navigate to the DDV.xla file on the CD-ROM or network drive, select it, and
click OK. Click OK if you are asked to write the DDV.xla file to the Library folder. The Add-In
Manager dialog box will now list the Dummy Dep Var Analysis (as depicted above).
The Add-In Manager lists all of the installed add-ins, and those with checkmarks are also loaded.
Microsoft offers the following advice, “To conserve memory, unload add-ins you do not use
often. Unloading an add-in removes its features and commands from Microsoft Excel, but the
add-in program remains on your computer so you can easily load it again.” [Microsoft Excel
Help, add-ins, overview]
In the Add-Ins available scroll box, make sure to select the check box next to the Dummy Dep
Var Analysis item (as shown above) and click OK.
Excel will load the DDV.xla file and notify you of successful installation with the following
message:
USING THE DDV.XLA ADD-IN:
Using the Dummy Dependent Variable Analysis add-in is
easy. Simply click on the Tools menu item and select the
Dummy Dep Var Analysis item to acesss a dialog box
from which data are provided.
Clicking on the Y and X Data buttons brings up input boxes
from which you select cells containing the Y and X data:
687317324
Page 3 of 6
Select one, two, three, or all of the four estimation choices and click OK. The DDV.xla add-in
uses Excel’s Solver to find the NLLS or ML solution. An important message warns against
uncritical acceptance of results:
The output is placed in a new sheet in the workbook with the data and looks something like this:
For the Probit ML example shown above, the objective function (the sum of the log likelihoods)
is in cell A2. The likelihood and log likelihood of each observation are in columns B and C.
The coefficients are placed, in order, down column A.
The cells in columns B and C contain formulas to verify that the appropriate calculations are
being computed and to enable changes to be made if necessary. If Solver does not yield a
solution, try different initial values or impose additional constraints.
Clicking the Analysis Options button reveals additional options:
Selecting the additional options and inputting the appropriate information (the Loan to Appraised
Value was used to create the table) yields results like this:
687317324
Page 4 of 6
Sum lnL Likelihood Ln Likelihood
-414.903 0.968892
-0.0316
Intercept
0.964897 -0.03573
-6.42957 0.97637 -0.02391
Loan to Appraised
0.975759
Value-0.02454
Ratio
7.759808 0.973183 -0.02718
Estimated Coefficients and SEs
Intercept Loan to Appraised
Years on
Value
Job
Black
Ratio
-6.42957 7.759808 -0.01084 0.739094
0.35536 0.425276 0.008603 0.101603
Years on Job0.99607
-0.01084 0.973183
Black
0.996547
0.739094 0.968125
0.968125
0.996365
0.994161
0.972104
0.96688
0.996594
0.995866
0.995452
0.973463
0.96921
0.963549
0.969525
0.968
Predicted Probability Table
-0.00394
-0.02718
-0.00346
-0.03239
-0.03239
-0.00364
-0.00586
-0.02829
-0.03368
-0.00341
-0.00414
-0.00456
-0.0269
-0.03127
-0.03713
-0.03095
-0.03252
Years on Job
Black
Average
9.841
0.505
While varying a particular X value, all other included X variables are held constant at their averages.
SDs away Loan to Appraised
Predicted
Value
Probability
Ratio
-2.5 0.386674 0.000782
Predicted Probability
-2 0.458839 0.004628
-1.5 0.531004 0.020552
-1 0.60317 0.069105
1.5
-0.5 0.675335 0.178133
1
0
0.7475 0.358483
0.5 0.819665 0.57827
0.5
1 0.89183 0.775613
0
1.5 0.963996 0.906155
0
0.2
0.4
0.6
0.8
1
2 1.036161 0.969771
Loan to Appraised Value Ratio
2.5 1.108326 0.992604
1.2
The Analysis Options button can be used repeatedly to create many different predicted
probability tables.
As determined by the data, you may have to clean up the results. For example, the variable Loan
to Appraised Value Ratio runs from 50to 100 percent, and so the default set of values in the table
from -2.5 to 2.5 standard units are not appropriate. In addition, using the default average of the
independent variables does not make sense when it is a dummy variable, and thus the 0.505
Black value should be changed to either a 0 or a 1. Finally, the axes on the chart should be
corrected. The cleaned up results look like this:
CLEANED UP Predicted Probability Table
Years on JobBlack
Average
9.841
1
While varying a particular X value, all other included X variables are held constant at their averages.
Loan to
Appraised Predicted
Value Ratio Probability
0.5
0.08%
Black Predicted Probability of Loan Denial
0.55
0.46%
0.6
2.06%
100.00%
0.65
6.91%
75.00%
0.7
17.81%
50.00%
0.75
35.85%
0.8
57.83%
25.00%
0.85
77.56%
0.00%
0.9
90.62%
0
0.2
0.4
0.6
0.8
0.95
96.98%
Loan to Appraised Value Ratio
1
99.26%
687317324
Page 5 of 6
1
THIS VERSION
The latest DDV.xla version is 10 June 2010
To check the date of your installed add-in, access the Add-Ins manager dialog box and then
highlight the add-in. The Add-Ins dialog box displays the date at the bottom.
.
To install this for the first time, please follow the instructions on the first page of this document.
To install over a previous version that is already installed, please see
InstallingAddinOverPreviousVersion.doc for detailed instructions. The procedure is basically this:
To install over a previous version, quit Excel and simply drag this new version into the Excel
Add-ins folder. If you do not know where this folder is, search for “DDV.xla” and then drag the
new version over the old one. Of course, you will want to accept rewriting over the previous
version. Launch Excel and you are ready to use the add-in.
ADDITIONAL HELP AND FEEDBACK:
If something goes wrong in the installation or loading process, an unexpected error keeps
recurring, or you have other problems, please contact us. Many problems are fixed by
uninstalling (unchecking in the Add-ins Manager, clicking OK) and reinstalling. We are
interested in your comments, suggestions, or criticisms of the DDV.xla software.
www.wabash.edu/econometrics
Humberto Barreto
DePauw University
hbarreto@depauw.edu
(765) 658-4531
687317324
Frank Howland
Wabash College
howlandf@wabash.edu
(765) 361–6317
Page 6 of 6
Download