*! version 25Oct2010
help pvdata

Title

pvdata -- Creating a dataset for pvplot (2010-10-25)

Syntax

pvdata [item-variables]
[,
options]

Selecting other variables

colorvars(colvars) Variables
to specify colors of the paths. More than one color variable can be
selected but only one at a time can be used in a plot.

id(ID-variable) ID variable.

othervars(othervars) Other variables to keep in dataset; these
variables do not need to be used in the plot.

Arranging variables

autoorder(category#) Arrange item variables from first to last
in the order correspondong to the percent in category category#.

Selecting and sorting of cases

descending Sort cases in descending order;
the default is ascending order.

method(stacked | uniform) If stacked (the default),
create offsets to stack the paths on top of each other.
With uniform the offsets are created so
that paths from categories with the same value for a given
ID are horizontal.

nosort Do not sort cases. By default, cases are sorted by the
values of the item-variables from the first item to last item.

sample(0-100) Sample this percent of cases. This is useful
for testing or for large datasets.

sortitems Add the item-variables to the end of list
of sort variables.
If you use this option, you do not need to include the item variables in the
list of sort variables.

sortvars(sortvars) Sort on these variables; if not specified,
sort using itemvars.

Other options

debug Run in test mode for debugging.

Description

pvdata creates a dataset used by pvplot to create a parallel
coordinates graph for categorical data.
The dataset includes item variables that are arranged on the x-axis.
Each item must be categorical with sequential categories. Further,
all categories must be observed for at least one item.
For example, if the minimum category is 1 and the maximum is 5,
at least one item must include cases for each category 1, 2, 3, 4, and 5.

You specify the K item variables and optionally specify the
ID variable, variables for sorting the cases, and other variables
indicating the color and intensity of the paths.

The dataset has K-1 rows for each case in the source dataset.
This dataset contains the coordinates of path segments, the values of
the items, the case ID, sort variables, and other variables.
For example, with 4 items, pvdata creates three rows in
the new datasest for each case in the source dataset:

Row 1: For case 1, information on item 1 and item 2.
Row 2: For case 1, information on item 2 and item 3.
Row 3: For case 1, information on item 3 and item 4.
Row 4: For case 2, information on item 1 and item 2.
Row 5: For case 2, information on item 2 and item 3.
Row 6: For case 2, information on item 3 and item 4.
< and so on >

pvplot plots the line segments from
coordinate (itemST,catST) to the coordinate (itemEN,catEN). These coordinates
are in these variables:

itemSTx The x-coordinate for the starting point.

catSTy The y-coordinate for the starting point.

itemENx The x-coordinate for the ending point.

catENy The y-coordinate for the ending point.

The y-coordinates are offset by the amounts contained in:

catSTyoff Offset for the starting y-coordinate.

catENyoff Offset for the ending y-coordinate.

The offset is necessary so that path segments from multiple
cases are not be graphed on top of each other.

Other variables created by pvdata for plotting are:

_pvrownum The row number from the source dataset
used to created a given row in the dataset created by pvdata.

_pvsortorder The row number in the dataset
created by pvdata, ranging from 1 to (K-1)*N. This variable can
be used if you sort the dataset created by pvdata and want
to restore the data to the original order. This will be rarely needed.

In addition to creating variables, pvdata sets the value of a global:

pvinteractive is set to 0 which indicates that the data in memory was
changed since the last pvplot was run. This tells pvplot to reset all
options to their defaults rather than keeping options at the values used the last
time pvplot was run. In other words, as soon as pvdata is run,
pvplot is placed in non-interactive mode.