Exploring Data in Two Dimensions

Line Plots

This section describes how to use a line plot to observe the behavior of one or more variables over time. You can also use line plots to visualize a response variable (and, optionally, fitted curves and confidence bands) versus values of an explanatory variable.

You can create line plots when your data are in one of two configurations. The first configuration (Table 6.1) is when you have an X variable and one or more Y variables. Each Y variable has the same number of observations as the X variable. (Some of the Y values might be missing.) In this configuration there are as many lines in the plot as there are Y variables.

Table 6.1: A Data Configuration for a Line Plot
X Y1 Y2
114
233
323
442
551

In the second configuration (Table 6.2), there is a single X and a single Y variable, but there are one or more group variables that specify which line each observation belongs to. In this configuration there are as many lines in the plot as there are unique values of the group variables.

Table 6.2: An Alternative Data Configuration for a Line Plot
X Y Group
11A
14B
23A
23B
32A
33B
44A
42B
55A
51B

The X variable does not need to be sorted in either configuration. Any data arranged in the first configuration can be rewritten in the second. For example, Table 6.2 represents the same data as Table 6.1. The second configuration is more useful if you have different values of the X variable for each group.


Example: Multiple Y Variables

Example: A Group Variable

Line Plot Properties

Line Plots of Selected Variables

Previous Page | Next Page | Top of Page