REGWGT Subcommand (REGRESSION command)

The only specification on REGWGT is the name of the variable containing the weights to be used in estimating a weighted least-squares model. With REGWGT, the default display is the usual REGRESSION display.

  • REGWGT is a global subcommand.
  • If more than one REGWGT subcommand is specified on a REGRESSION procedure, only the last one is in effect.
  • REGWGT can be used with MATRIX OUT but not with MATRIX IN.
  • Residuals saved from equations using the REGWGT command are not weighted. To obtain weighted residuals, multiply the residuals created with SAVE by the square root of the weighting variable in a COMPUTE statement.
  • REGWGT is in effect for all equations and affects the way the correlation matrix is built. Thus, if REGWGT is specified on a REGRESSION procedure that writes matrix materials to a matrix data file, subsequent REGRESSION procedures using that file will be automatically weighted.

Example

REGRESSION VARIABLES=GRADE GPA STARTLEV TREATMNT
 /DEPENDENT=GRADE
 /METHOD=ENTER
 /SAVE PRED(P).
COMPUTE WEIGHT=1/(P*(1-P)).
REGRESSION VAR=GRADE GPA STARTLEV TREATMNT
 /REGWGT=WEIGHT
 /DEP=GRADE
 /METHOD=ENTER.
  • VARIABLES builds a correlation matrix that includes GRADE, GPA, STARTLEV, and TREATMNT.
  • DEPENDENT identifies GRADE as the dependent variable.
  • METHOD regresses GRADE on GPA, STARTLEV, and TREATMNT.
  • SAVE saves the predicted values from the regression equation as variable P in the active dataset. See the topic SAVE Subcommand (REGRESSION command) for more information.
  • COMPUTE creates the variable WEIGHT as a transformation of P.
  • The second REGRESSION procedure performs a weighted regression analysis on the same set of variables using WEIGHT as the weighting variable.

Example

REGRESSION VAR=GRADE GPA STARTLEV TREATMNT
 /REGWGT=WEIGHT
 /DEP=GRADE
 /METHOD=ENTER
 /SAVE RESID(RGRADE).
COMPUTE WRGRADE=RGRADE * SQRT(WEIGHT).
  • This example illustrates the use of COMPUTE with SAVE to weight residuals.
  • REGRESSION performs a weighted regression analysis of GRADE on GPA, STARTLEV, and TREATMNT, using WEIGHT as the weighting variable.
  • SAVE saves the residuals as RGRADE. These residuals are not weighted.
  • COMPUTE creates variable WRGRADE, which contains the weighted residuals.