Command Reference : Function Reference : Function Reference: W
  
 
@wexpand
Special Expression
String representation of automatic dummy variables.
Return the string list associated with automatically created dummy variables from numeric or alpha series.
Syntax: @wexpand(ser1[, ser2, ser3, ...][, s]))
ser1: series, alpha
ser2...: series, alpha
s: (optional) sample string or object
Return: string
returns the string corresponding to the set of dummy variables that span the unique values of the input series ser1, ser2, etc. These may be numerical series with integer only values, alpha series or links.
By default, the definition of the categories will use the current workfile sample, but you may specify an explicit sample s.
Example
For example, consider the following two variables:
SEX is a numeric series which takes the values 1 and 0.
REGION is an alpha series which takes the values “North”, “South”, “East”, and “West”.
The command:
%str = @wexpand(sex)
yields the string SEXLIST containing “SEX=0 SEX=1”.
The @wexpand statement in,
%str = @wexpand(sex, region)
yields a space delimited string list SREGION with elements:
“SEX=0 AND REGION=""North""”
“SEX=0 AND REGION=""South""”
“SEX=0 AND REGION=""East""”
“SEX=0 AND REGION=""West""”
“SEX=1 AND REGION=""North""”
“SEX=1 AND REGION=""South""”
“SEX=1 AND REGION=""East""”
“SEX=1 AND REGION=""West""”
Cross-references
See “Automatic Categorical Dummy Variables” for further discussion. See also @expand.