---------------------- help for olsdiag ----------------------
Diagnostics for OLS Regression ------------------------------
olsdiag [ , id(id variables) sort(sort variable) Install Update Save Full]
olsdiag is a menu driven program for running diagnostic plots and tests following a regression analysis. Select the diagnostic that you wish to perform from the pulldown menu and then click the show button and the diagnostic will be shown. The command issued will be shown in the results window if you wish to run the command yourself with other options.
The size and symbol options allow you to choose how the symbols will appear and how they will be sized. The magnification option allows you to magnify the symbols when you choose a symbol aside from standard circles.
NOTE! BUG! When you use both the symbol and size options, the size of the item being plotted may NOT be proportional to the size variable chosen. This has been reported to Stata (as of 12/2002) and they have acknowledged the problem and will fix it in a future update of Stata. It appears that choosing larger values of magnification (i.e. psize) is a workaround for this problem.
You can click the help button and it will show you the help file for the command that you have selected in the pulldown menu.
Click on done when you wish to close the program.
If you supply the id() option, the value of the id variable(s) will be available as one of the symbols to plot as the symbol and size in the graph. Otherwise __obsnum is created and can be used to identify observations by their observation number.
The sort() option allows you to specify a sort variable for the indexplot command. The index plots will be sorted by the variable that you specify with the sort option.
Because olsdiag uses a number of add on ado files, it is likely that you will not have some of the ado files called by this program installed. If you use the install option, any needed ado files that you do not have will be installed. Of course, you will need to be connected to the internet for this option to work properly.
If you use the update option, all ado files that olsdiag calls will be downloaded (even if they are already installed) assuring you that all of these files are up to date. The save option saves the values created with the predict command, namely
Name Description __predicted Linear prediction __residual Residuals __rstandard Standardized residuals __rstudent Studentized residuals __DFbeta_* DFBeta for each predictor __cooksd Cook's D __leverage Leverage __covartio Covratio __dfits Dfits __welsch Welsch distance __ABSpredicted abs(predicted) __ABSresidual abs(residuals) __ABSrstandard abs(rstandard) __ABSrstudent abs(rstudent) __ABSDFbeta_* abs(DFbeta for each predictor) __ABSdfits abs(dfits) __ABSwelsch abs(welsch)
The absolute values are saved so they can be used as weights in the graphs. Otherwise, the values with negative weights would be weighted as zero.
The full option is used to see the full set of diagnostics available. By default, a subset of all possible diagnostics are shown.
Cutomization for Experts ------------------------
It is very easy to customize olsdiag. Each menu item is represented by 3 lines of code in the program, like this.
local itemnum = `itemnum' + 1 global DB_menu_item`itemnum' "- Summary of Diagnostic Measures" global DB_menu_cmd`itemnum' "diag, id(`id') nolist"
This item adds "- Summary of Diagnostic Measures" to the menu and when chosen runs the command diag, id(`id') nolist where `id' is substituted with the id variable supplied on the olsdiag command line.
. olsdiag . olsdiag, install . olsdiag, id(myid)
Michael N. Mitchell Statistical Computing and Consulting UCLA, Academic Technology Services mnmatucla.edu
This program is merely a shell that calls built in Stata commands and programs written by others, including (in alphabetical order)
- Nicholas J. Cox - Phil Ender - Jeroen Weesie
I am grateful for their contributions and hope that they do not mind that their programs are called as part of this program.
I am also very grateful to Phil Ender, Xiao Chen, and Christine Wells for terrific comments and suggestions.