27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

VARSTOCASES 1653<br />

• The basic specification is /INDEX=ivar(n) ivar(n) ..., where ivar is the name of the new<br />

index for a factor and n is the number of factor levels represented in the variable group<br />

for which the index is being constructed.<br />

• The last index specified varies the fastest.<br />

Example<br />

B1 B2<br />

A1 .00 .05<br />

A2 5.00 3.00<br />

• Data were collected for a designed experiment with two levels of factor A and two levels<br />

of factor B. The table shows the data for the first case.<br />

caseid v_a1b1 v_a1b2 v_a2b1 v_a2b2<br />

001 .00 .05 5.00 3.00<br />

• The original data file is structured so that each case has one variable for each combination<br />

of factors. Note that factor B varies fastest.<br />

VARSTOCASES<br />

/MAKE newvar FROM v_a1b1 TO v_a2b2<br />

/INDEX=a(2) b(2).<br />

caseid a b newvar<br />

001 1 1 .00<br />

001 1 2 .05<br />

001 2 1 5.00<br />

001 2 2 3.00<br />

• The command restructures the data file and creates two indices, A and B.<br />

NULL Subcommand<br />

The NULL subcommand checks each potential new row for null values. A null value is a<br />

system-missing or blank value. By default, VARSTOCASES does not add a new row that<br />

contains null values for all variables created by MAKE subcommands. You can change the<br />

default null-value treatment with the NULL subcommand.<br />

DROP Do not include a new row when all MAKE variables are null. A potential new row<br />

with null values for all of the variables created by MAKE subcommands is excluded<br />

from the new data file. This is the default.<br />

With this option, you may want to create a count variable to keep track of new rows,<br />

because cases in the original data file are not guaranteed to appear in the new data<br />

file.<br />

KEEP Include a new row when all MAKE variables are null. A potential new row with<br />

null values for all of the variables created by the MAKE subcommand is included in<br />

the new data.<br />

With this option, you may not need a count variable to keep track of cases because<br />

each row in the original data will result in a consistent number of rows in the new<br />

data file.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!