User Guide
217
File Handling a
nd Fi le Transformations
Example. The variables to be restructured are w and h, and the index is month:
w
h month
Grouping by variable results in:
w.jan w.feb h.jan
Grouping by index results in:
w.jan h.jan w.feb
Create a count variable? The wizard can create a count variable in the new file. It
contain
s the number of rows in the current data that were used to create a row in
the new data file.
Create indicator variables? The wizard can use the index variables to create indicator
variabl
es in the new data file. It creates one new variable for each unique value of the
index variable. The indicator variables signal the presence or absence of a value for a
case. An indicator variable has the value of 1 if the case has a value; otherwise, it is 0.
Exampl
e.
The index variable is product. It records the products that a customer
purchased. The original data are:
customer
product
1chick
1
eggs
2
eggs
3chick
Creating an indicator variable results in one new variable for each unique value
of product. The restructured data are:
customer
indc
hick
inde
ggs
111
201
310