Overview (WEIGHT command)
WEIGHT
gives
cases different weights (by simulated replication) for statistical
analysis. WEIGHT
can be used
to weight a sample up to population size for reporting purposes or
to replicate an example from a table or other aggregated data. With WEIGHT
, you can arithmetically alter the
sample size or its distribution.
To apply weights resulting from your sampling design, see SPSS® Statistics Premium Edition or the Complex Samples option.
Basic Specification
The basic
specification is keyword BY
followed
by the name of the weight variable. Cases are weighted according to
the values of the specified variable.
Syntax Rules
- Only one numeric variable can be specified. The variable can be a precoded weighting variable, or it can be computed with the transformation language.
-
WEIGHT
cannot be placed within aFILE TYPE—END FILE TYPE
orINPUT PROGRAM—END INPUT PROGRAM
structure. It can be placed nearly anywhere following these commands in a transformation program. See the topic Commands and Program States for more information.
Operations
- Unlike most
transformations,
WEIGHT
takes effect as soon as it is encountered in the command sequence. Thus, special attention should be paid to its position among commands. See the topic Command Order for more information. - Weighting is permanent during a session unless it is preceded by
a
TEMPORARY
command, changed by anotherWEIGHT
command, or turned off with theWEIGHT OFF
specification. - Each
WEIGHT
command overrides the previous one. -
WEIGHT
uses the value of the specified variable to arithmetically replicate cases for subsequent procedures. Cases are not physically replicated. - Weight values do not need to be integer, and some procedures, such as
FREQUENCIES
,CROSSTABS
, andCTABLES
, will use fractional values on theWEIGHT
variable. However, most procedures treat theWEIGHT
variable as a replication weight and will simply round fractional weights to the nearest integer. Some procedures ignore theWEIGHT
variable completely, and this limitation is noted in the procedure-specific documentation. Procedures in the Complex Samples add-on module can use inverse sampling weights specified on theCSPLAN
command. - Cases with missing or nonpositive values for the weighting variable are treated as having a weight of 0 and are thus invisible to statistical procedures. They are not used in calculations even where unweighted counts are specified. These cases do remain in the file, however, and are included in case listings and saved when the file is saved.
- A file saved when weighting is in effect maintains the weighting.
- If the weighted number of cases exceeds the sample size, tests of significance are inflated; if it is smaller, they are deflated.