3-D Bar Examples (XGRAPH command)

A 3-D bar chart is a bar chart with two categorical axes (x and z). The height of the bars is determined by a summary function. The categories on the x- and z-axes can be values of categorical variables, separate variables, or individual cases.

Examples of Summaries for Groups of Cases

XGRAPH CHART=([COUNT] [BAR]) BY jobcat[c] by gender[c].
  • The bars in the chart represent counts for males and females in each job category.
    XGRAPH CHART=(salary [MEAN] [BAR])> educ[PATTERN] BY jobcat[c] >
    minority[COLOR] by gender[c].
  • The bars in the chart represent the mean salary for males and females in each job category clustered by minority membership.
  • The bars are also stacked by education level.
  • Clusters are distinguished by color, and stacks are distinguished by pattern.

Example of Summaries of Separate Variables by Group

XGRAPH CHART=((salary + salbegin) [MEAN] [BAR]) BY 1 BY gender[c].
  • The bars in the chart represent the mean current salary and mean beginning salary for males and females.
  • The blending operator (+) indicates that the chart is for separate variables.
  • The 1 placeholder indicates the axis on which the separate variables appear.
  • The variables appear on the x-axis, and the gender categories are on the z-axis.

Examples of Individual Cases in Groups

XGRAPH CHART=(salary [VALUE] [BAR]) BY gender[c] BY $CASENUM.
  • The bars in the chart represent the current salary for each case with the cases grouped by gender.
  • VALUE is the only function available when creating charts of individual cases.

Examples for Values of Individual Cases for Separate Variables

XGRAPH CHART=((salary + salbegin) [VALUE] [BAR]) BY $CASENUM BY 1.
  • The bars in the chart represent the value of the current salary and the value of the beginning salary for every case.
  • The cases are on the x-axis, and the variables are on the z-axis.
    XGRAPH CHART=((salary + salbegin) [VALUE] [BAR]) BY
    $CASENUM[LABEL=gender] BY 1.
  • This is the same as the previous example except that the bars are labeled by gender.