Overview (WLS command)
WLS
(weighted
least squares) estimates regression models with different weights
for different cases. Weighted least squares should be used when errors
from an ordinary regression are heteroscedastic—that is, when
the size of the residual is a function of the magnitude of some variable,
termed the source.
The WLS
model
is a simple regression model in which the residual variance is a function
of the source variable, up to some power transform indicated by a
delta value. For fuller regression results, save the weights produced
by WLS
and specify that weight
variable on the REGWGT
subcommand
in REGRESSION
.
Options
Calculated and Specified Weights. WLS
can calculate the weights based on a source variable
and delta values (subcommands SOURCE
and DELTA
), or it can apply
existing weights contained in a series (subcommand WEIGHT
). If weights are calculated, each
weight value is calculated as the source series value raised to the
negative delta value.
New Variables. You can change NEWVAR
settings on the TSET
command prior to WLS
to evaluate the regression coefficients and log-likelihood function
without saving the weight variable, or save the new values to replace
the values saved earlier, or save the new values without erasing values
saved earlier (see the TSET
command).
You can also use the SAVE
subcommand
on WLS
to override the NONE
or the default CURRENT
settings on NEWVAR
for the current procedure.
Statistical Output. You can change the PRINT
setting on the TSET
command prior to WLS
to display regression coefficients or the list of log-likelihood
functions at each delta value, or to limit the output to only the
regression statistics for the delta value at which the log-likelihood
function is maximized (see the TSET
command). You can also use the PRINT
subcommand to override the PRINT
setting on the TSET
command
for the current procedure and obtain regression coefficients at each
value of delta in addition to the default output.
Basic Specification
- The basic specification
is the
VARIABLES
subcommand specifying one dependent variable, the keywordWITH
, and one or more independent variables. Weights are calculated using the first independent variable as the source variable and a default delta value of 1. - The default output for calculated weights displays the log-likelihood function for each value of delta. For the value of delta at which the log-likelihood function is maximized, the displayed summary regression statistics include R, R 2, adjusted R 2, standard errors, analysis of variance, and t tests of the individual coefficients. A variable named WGT#1 containing the calculated weights is automatically created, labeled, and added to the active dataset.
Syntax Rules
-
VARIABLES
can be specified only once. -
DELTA
can be specified more than once. Each specification will be executed. - If other subcommands are specified more than once, only the last specification of each one is executed.
- You can specify either
SOURCE
andDELTA
, or just theWEIGHT
subcommand. You cannot specify all three, and you cannot specifyWEIGHT
withSOURCE
or withDELTA
.
Subcommand Order
- Subcommands can be specified in any order.
Operations
- If neither the
WEIGHT
subcommand nor theSOURCE
andDELTA
subcommands are specified, a warning is issued and weights are calculated using the default source and delta value. - Only one WGT#1 variable is created per procedure. If more than one delta value is specified, the weights used when the log-likelihood function is maximized are the ones saved as WGT#1.
- WGT#1 is not created when the
WEIGHT
subcommand is used. - The
WEIGHT
command specifies case replication weights, which are not the same as the weights used in weighted least squares. If theWEIGHT
command andWLS WEIGHT
subcommand are both specified, both types of weights are incorporated inWLS
. -
WLS
uses listwise deletion of missing values. Whenever one variable is missing a value for a particular observation, that observation will not be included in any computations.
Limitations
- Maximum one
VARIABLES
subcommand. - Maximum one dependent variable on the
VARIABLES
subcommand. There is no limit on the number of independent variables. - Maximum 150 values specified on the
DELTA
subcommand.