GRAPH
GRAPH
is available in the Statistics Base Edition.
GRAPH
creates bar charts, pie charts, line charts, error bar charts, high-low-close
charts, scatterplots, and Pareto charts.
GRAPH
[/TITLE='line 1' ['line 2']]
[/SUBTITLE='line 1']
[/FOOTNOTE='line 1' ['line 2']]
{/BAR [{(SIMPLE) }]=function/variable specification† }
{(GROUPED) }
{(STACKED) }
{(RANGE) }
{/LINE [{(SIMPLE) }]=function/variable specification† }
{(MULTIPLE) }
{(DROP) }
{(AREA) }
{(DIFFERENCE)}
{/PIE }
{/PARETO[{(CUM) }][{(SIMPLE) }]=function/variable specification†}
{(NOCUM)} {(STACKED)}
{/HILO[{(SIMPLE) }]=function/variable specification†† }
{(GROUPED)}
{/HISTOGRAM [(NORMAL)]=var }
{/SCATTERPLOT[{(BIVARIATE)}]=variable specification††† }
{(OVERLAY) }
{(MATRIX) }
{(XYZ) }
{/ERRORBAR[{(CI[{95}]) }]={var [var var ...][BY var]} }
{n } {var BY var BY var }
{(STERRIR[{12}])}
{n }
{(STDDEV[{2}]) }
{n}
[/PANEL COLVAR=varlist COLOP={CROSS**} ROWVAR=varlist ROWOP={CROSS**}]
{NEST } {NEST }
[/INTERVAL {CI {(95)}}]
{(n) }
{STDDEV {(2) }}
{(n) }
{SE {(2) }}
{(n) }
[/TEMPLATE=file]
[/MISSING=[{LISTWISE**}][{NOREPORT**}][{EXCLUDE**}]]
{VARIABLE }] {REPORT } {INCLUDE }
** Default if the subcommand is omitted.
This command reads the active dataset and causes execution of any pending commands. See the topic Command Order for more information.
Release History
Release 13.0
-
PANEL
subcommand introduced. -
INTERVAL
subcommand introduced.
Value function:
The VALUE
function yields the value of the specified
variable for each case. It always produces one bar, point, or slice
for each case. The VALUE(X)
specification implies
the value of X by n, where n is the number of
each case. You can specify multiple variables, as in:
GRAPH /BAR = VALUE(SALARY BONUS BENEFIT).
This command draws a bar chart with the values of SALARY, BONUS,
and BENEFIT for each employee (case). A BY
variable
can be used to supply case labels, but it does not affect the layout
of the chart, even if values of the BY
variable are
the same for multiple cases.
Aggregation functions:
Two groups of aggregation functions are available: count functions and summary functions.
Count functions:
COUNT. Frequency of cases in each category.
PCT. Frequency of cases in each category expressed as a percentage of the whole.
CUPCT. Cumulative percentage sorted by category value.
CUFREQ. Cumulative frequency sorted by category value.
- Count functions yield the count or percentage of valid cases within
categories determined by one or more
BY
variables, as in:GRAPH /BAR (SIMPLE) = PCT BY REGION.
- Count functions do not have any arguments.
- You can omit the keyword
COUNT
and the subsequent keywordBY
and specify just a variable, as in
GRAPH /BAR = DEPT.
This command is interpreted as
GRAPH /BAR = COUNT BY DEPT.
Summary functions:
MINIMUM. Minimum value of the variable.
MAXIMUM. Maximum value of the variable.
N. Number of cases for which the variable has a nonmissing value.
SUM. Sum of the values of the variable.
CUSUM. Sum of the summary variable accumulated across values of the category variable.
MEAN. Mean.
STDDEV. Standard deviation.
VARIANCE. Variance.
MEDIAN. Median.
GMEDIAN. Group median.
MODE. Mode.
PTILE(x). Xth percentile value of the variable. X must be greater than 0 and less than 100.
PLT(x). Percentage of cases for which the value of the variable is less than x.
PGT(x). Percentage of cases for which the value of the variable is greater than x.
NLT(x). Number of cases for which the value of the variable is less than x.
NGT(x). Number of cases for which the value of the variable is greater than x.
PIN(x1,x2) . Percentage of cases for which the value of the variable is greater than or equal to x1 and less than or equal to x2. x1 cannot exceed x2.
NIN(x1,x2) . Number of cases for which the value of the variable is greater than or equal to x1 and less than or equal to x2. x1 cannot exceed x2.
- Summary functions are usually used with summary variables (variables
that record continuous values, such as age or expenses). To use a
summary function, specify the name of one or more variables in parentheses
after the name of the function, as in:
GRAPH /BAR = SUM(SALARY) BY DEPT.
- You can specify multiple summary functions for more chart types. For example, the same function can be applied to a list of variables, as in:
GRAPH /BAR = SUM(SALARY BONUS BENEFIT) BY DEPT.
This syntax is equivalent to:
GRAPH /BAR = SUM(SALARY) SUM(BONUS) SUM(BENEFIT) BY DEPT.
Different functions can be applied to the same variable, as in:
GRAPH /BAR = MEAN(SALARY) MEDIAN(SALARY) BY DEPT.
Different functions and variables can be combined, as in:
GRAPH /BAR = MIN(SALARY81) MAX(SALARY81)
MIN(SALARY82) MAX(SALARY82) BY JOBCAT.
The effect of multiple summary functions on the structure of the charts is illustrated under the discussion of specific chart types.