help pvdata: Help for constructing data for pvplot - 2009-10-11

Overview

The command pvdata creates data appropriate for plotting with
pvplot.

Syntax

pvdata varlist
[, options]

id(varname) Name of id variable in source dataset.

autoorder(#) Arrange items to be plotted from left to right
in the order that corresponds to percent in this category.

nosort Do not sort items from first item to last item.

descending Sort in descending order.

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

colorvars(sortlist) Variables used for determining colors.

method(stacked | uniform) If stacked (default),
create offsets to stack the paths on top of each other; if uniform, make
offsets such that paths from categories with the same value for a given
id will be horizontal.

sample(0-100) Sample this percent of cases; used with testing or
for large datasets.

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

debug Run in test mode for debugging.

oldsort To be documented....

************************************
*option here to save the data--SLR
************************************

Discussion

The dataset created by pvdata includes categorical variables to be plotted
with pvplot. Variables to be plotted are called items. Each item must
have categorical values, referrred to as categories. Categories must be
sequential with all categories being observed values in the dataset. 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 must specify the K item-variables and can optionally specify an
id-variable, variables used to sort the data, and other variables.
The dataset created by pvdata has K-1 rows for each observation in the
source dataset. For a given observation from the source dataset, each row in the
dataset constructed by pvdata has information on a line segment
from item k to k-1. For example, with four items, the first row for
an observation will define the line segment from item 1 to item 2; the
second from item 2 to item 3; the third from item 3 to item 4.

The output dataset will include item-variables, an id-variable, sort-variables,
and other variables, with each item duplicated in each row of the dataset.
For example, suppose the source data has an id and three items with three
categories. For id=1:

1 1 3 2

the pvdata dataset will include this information K-1 times:

1 1 3 2
1 1 3 2
1 1 3 2

This data is not necessary for plotting, but could be used for supplementary
analyses. <unclear!>

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

itemSTx The x-coordinate for the starting point.

catSTy The base y-coordinate for the starting point.

itemENx The x-coordinate for the ending point.

catENy The base y-coordinate for the ending point.

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

catSTyoff Offset for starting y-coordinate.

catENyoff Offset for ending y-coordinate.

The variables created by pvdata for plotting are:

_pvrownum This PV id number is 1 for the first observation from the
sorted source data, 2 for the second, and so on.

_pvsortorder This indicates the order of the data
in the pvdata dataset, 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 is not likely to be used
often.

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

pvmod 0 if new data; existing PVStata globals are reset;
1 if existing PVStata graph is being modified using other globals.