Variable lists (SELECTPRED command)

The variable lists specify the dependent variable, any categorical predictors (also known as factors), and any scale predictors (also known as covariates).

  • The dependent variable must be the first specification on SELECTPRED.
  • The dependent variable may not be the weight variable.
  • The dependent variable may be followed by the measurement-level specification, which contains, in parentheses, the MLEVEL keyword followed by an equals sign and then S for scale, O for ordinal, or N for nominal. SELECTPRED treats ordinal and nominal dependent variables equivalently as categorical.
  • If a measurement level is specified, it temporarily overrides the dependent variable's setting in the data dictionary.
  • If no measurement level is specified, SELECTPRED defaults to the dictionary setting.
  • If a measurement level is not specified, and no setting is recorded in the data dictionary, a numeric variable is treated as scale and a string variable is treated as categorical.
  • A string variable may be defined as ordinal or nominal only.
  • The names of the factors, if any, must be preceded by the keyword BY. If BY is specified with no factors, a warning is issued, and the keyword is ignored.
  • The names of the covariates, if any, must be preceded by the keyword WITH. If WITH is specified without covariates, a warning is issued, and the keyword is ignored.
  • If the dependent variable or the weight variable is specified within a factor list or a covariate list, the variable is ignored in the list.
  • All variables that are specified within a factor or covariate list must be unique. If duplicate variables are specified within a list, the duplicates are ignored.
  • If duplicate variables are specified across the factor and covariate lists, an error is issued.
  • The universal keywords TO and ALL may be specified in the factor and covariate lists.
  • If neither BY nor WITH is specified, all variables in the active dataset except the dependent variable, the weight variable, and any variables that are specified on the EXCEPT subcommand, are treated as predictors. If the dictionary setting of a predictor is nominal or ordinal, the predictor is treated as a factor. If the dictionary setting is scale, the predictor is treated as a covariate.
  • The dependent variable and factor variables can be numeric or string.
  • The covariates must be numeric.