|
Chapter Contents |
Previous |
Next |
| The REG Procedure |
The model and corresponding statistics are not recomputed after a REWEIGHT statement. For example, with the following statements
reweight r.>0; reweight r.>0;
the second REWEIGHT statement does not exclude any additional observations since the model is not recomputed after the first REWEIGHT statement. Use either a REFIT statement to explicitly refit the model, or implicitly refit the model by following the REWEIGHT statement with any other interactive statement except a PAINT statement or another REWEIGHT statement.
The REWEIGHT statement cannot be used if a TYPE=CORR, TYPE=COV, or TYPE=SSCP data set is used as an input data set to PROC REG. Note that the syntax used in the REWEIGHT statement is the same as the syntax in the PAINT statement.
The syntax of the REWEIGHT statement is described in the following sections. For detailed examples of using this statement see the section "Reweighting Observations in an Analysis".
Condition is used to find observations to be reweighted. The syntax of condition is
variable compare valueor
variable compare value logical variable compare valuewhere
reweight name='steve';
and
reweight name='Steve';
are not the same.
Examples of the variable compare value form are
reweight obs. le 10; reweight temp=55; reweight type='new';
Examples of the variable compare value logical variable compare value form are
reweight obs.<=10 and residual.<2; reweight student.<-2 or student.>2; reweight name='Mary' | name='Susan';
reweight allobs / reset;
resets weights for all observations and uses all observations in the subsequent analysis. Note that
reweight allobs;
specifies that all observations be excluded from analysis. Consequently, using ALLOBS is useful only if you also use one of the options discussed in the following section.
The following options can be used when either a condition, ALLOBS, or nothing is specified before the slash. If only an option is listed, the option applies to the observations selected in the previous REWEIGHT statement, not to the observations selected by reapplying the condition from the previous REWEIGHT statement. For example, with the statements
reweight r.>0 / weight=0.1; refit; reweight;
the second REWEIGHT statement excludes from the analysis only those observations selected in the first REWEIGHT statement. No additional observations are excluded even if there are new observations that meet the condition in the first REWEIGHT statement.
Note: Options are not available when either the UNDO or STATUS option is used.
reweight / reset;
resets observation weights to the original weights in the data set. If previous REWEIGHT statements have been submitted, this REWEIGHT statement applies only to the observations selected by the previous REWEIGHT statement. Note that, although the RESET option does reset observation weights to their original values, it does not cause the model and corresponding statistics to be recomputed.
reweight name='Alan'; ...other interactive statements reweight / weight=0.5;The first REWEIGHT statement changes weights to zero for all observations with name='Alan', effectively deleting these observations. The subsequent analysis does not include these observations. The second REWEIGHT statement applies only to those observations selected by the previous REWEIGHT statement, and it changes the weights to 0.5 for all the observations with NAME='Alan'. Thus, the next analysis includes all original observations; however, those observations with NAME='Alan' have their weights set to 0.5.
If you omit condition and the ALLOBS options, you can specify one of the following options.
reweight student.>2 / weight=0.1; reweight; reweight undo;the first REWEIGHT statement sets the weights of observations that satisfy the condition to 0.1. The second REWEIGHT statement sets the weights of the same observations to zero. The third REWEIGHT statement undoes the second, changing the weights back to 0.1.
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.