|
XTXINV MATRIXName:
The X matrix is typically a design matrix for a multiple linear regression. The (X'X)-1 matrix is useful for many regression diagnostic computations. For example, the help for the FIT command describes the use of the (X'X)-1 matrix in generating partial regression plots, partial leverage plots, and variance inflation factors. It is also used to compute various intervals for multiple linear regression problems. This command simplifies writing macros to compute these, as well as other, regression diagnostics. Although this matrix can be read in after performing a linear fit, this command simplifies its computation.
where <mat1> is the design matrix for which the (X'X)-1 matrix is to be computed; <mat2> is a matrix where the resulting (X'X)-1 matrix is saved; and where the <SUBSET/EXCEPT/FOR qualification> is optional (and rarely used in this context).
"Applied Regression Analysis", 2nd ed., Draper and Smith, John Wiley, 1981. "Residuals and Influence in Regression", Cook and Weisberg, Chapman and Hall, 1982. "Regression Diagnostics", Belsley, Kuh, and Welsch, John Wiley, 1980.
. Sample program to compute DFBETA's ECHO ON DIMENSION 100 COLUMNS SKIP 25 READ HALD647.DAT Y X1 X2 X3 X4 FIT Y X1 X2 X3 X4 SKIP 1 SET READ FORMAT E15.7,65X,E15.7 READ DPST3F.DAT HII ESTUD SKIP 0 SET READ FORMAT . LET N = SIZE X1 LET X0 = SEQUENCE 1 1 N LET Z = CREATE MATRIX X0 X1 X2 X3 X4 . LET XTXINV = XTXINV MATRIX Z LET C = CATCHER MATRIX Z LOOP FOR K = 1 1 5 LET TEMP1 = C^K LET TEMP2 = XTXINV^K(K) LET DFBETA^K = TEMP1*ESTUD/SQRT(TEMP2*(1-HII)) END OF LOOP LET N = SIZE Y LET XTEMP = SEQUENCE 1 1 N . CHARACTER B0 B1 B2 B3 B4 B5 BLANK BLANK LINE BLANK BLANK BLANK BLANK BLANK DOTTED DOTTED X1LABEL SEQUENCE Y1LABEL DFBETA TIC OFFSET UNITS SCREEN TIC OFFSET 5 5 . LET XGRID = DATA 1 N LET YGRID = DATA 1 1 LET YGRID2 = DATA -1 -1 PLOT DFBETA1 DFBETA2 DFBETA3 DFBETA4 DFBETA5 VERSUS XTEMP AND PLOT YGRID YGRID2 VERSUS XGRID
Date created: 7/22/2002 |