{smcl}
*  rdiagrbst version 1.0  Robert A. Yaffee  9 July 2012
{cmd:help rdiagrbst}
{hline}

{title:Title}

{p2colset 5 18 20 2}
{p2col:{hi:rdiagrbst} {hline 2} Executes a regression diagnostic analysis when a robust variance has been used.{p_end}
{p2olreset}


{phang}


{title:Syntax}  

{cmd:rdiagrbst {it:resx2}}
                        
                        where resx2 is any name the user assigns to the standardized residuals prior to diagnosis.

{p 8 17 2}


{title:Description}     {pstd}{cmd:rdiagrbst} automatically performs a residual diagnostic battery
                        of tests.   The first set of tests begins with a {bf:stem and leaf plot} of the 
                        standardized residuals.  Next, the top and bottom five {bf:extreme values}, along
                        with the ids to which they belong, are listed.  The id codes for the 
                        positive and negative {bf:outliers} (those standardized observations greater than
                        3.5 and less than -3.5 standard deviations above and below the mean are listed.
                        The critical values of {bf:Cook's D} is given for the data and any observations
                        with values in excess of the critical value are listed.  If there are none,
                        nothing is listed.  Otherwise, those with positive leverage are listed and those
                        with negative leverage are listed.
                                                
                        Multicollinearity tests follow with the {bf:Variance Inflation Factor (VIF)}
                        and the {bf:condition number} of the scaled variables.
                        
                        Residual Normality tests are also performed. They include the {bf:Shapiro-Wilk
                        W} test, the {bf:Jargue-Bera} test, and the {bf:Kolmogorov-Smirnov} test.
                        
                        Finally, the {bf:Ramsey Reset test} is given as a form of specification error
                        test.
                        
{title: Options}        There are no options.


{title: Graphs}         Four diagnostic graphs are generated.  The are positioned in a 2 by 2 matrix.
                        In the upper left is a quantile normal plot, which defines the distributional 
                        deviation from the normal diagonal.  A box and Wisker plot is in the upper right,
                        giving another sense of outliers symmetry and the interquartile range with the 
                        horizontal line representing the median.  In the lower left, is an outlier
                        influence plot and in the lower right is a histogram with a theoretical normal
                        line overlaid.


{title: return list}    Data returned when the user types: return list
                        r(totout)  =   number of outliers whose abs(sd) > 3.5
                        r(negoutliers) = number of negative outliers
                        r(posoutliers) = number of positive outliers
                        r(dfcritval) = 2*sqrt(p/n) = critical value for Dffits
                        r(badout) = number of outliers that have a significant critical value for Cook's D (criterion 1)


{title: Examples}
{title: Example 1}      regress y x1 x2 x3
						rdiagrbst r1
					   
{title: Example 2}      regress y x1 x2 z1 z2
						rdiagrbst r2
						
						where r1 and r2 are the names that the user assigns to the standadized residuals of the model being
						diagnosed.					
						                                                
{Author: Robert A. Yaffee}  Silver School of Social Work
                            New York University
                            robert.yaffee@nyu.edu


{end}
