AGRAPH procedure

Plots one- or two-way tables of means from ANOVA (R.W. Payne).


Options

GRAPHICS = string
Type of graph (highresolution, lineprinter); default high

METHOD = string
What to plot: means to plot just the means, lines to plot the means joined by lines, data to plot lines joining the mean values and points representing the original data, and barchart to plot the means in a bar chart (means, lines, data, barchart); default mean

XFREPRESENTATION = string
How to label the x-axis (levels, labels); default labels uses the XFACTOR labels, if available

PSE = string
What to plot to represent variation (differences, lsd, means, allmeans); default diff

COMBINATIONS = string
Factor combinations for which to form predicted means (present, estimable); default esti

ADJUSTMENT = string
Type of adjustment to be made when predicting means (marginal, equal, observed); default marg

LSDLEVEL = scalar
Significance level (%) to use for least significant differences; default 5

SAVE = ANOVA or regression save structure
Save structure to provide the table of means if the MEANS parameter is unset; default uses the save structure from the most recent ANOVA


Parameters

XFACTOR = factors
Factor providing the x-values for each plot; by default this is chosen automatically

GROUPS = factors or pointers
Factor or factors identifying the different lines from a multi-way table; by default chosen automatically

TRELLISGROUPS = factors or pointers
Factor or factors specifying the different plots of a trellis plot of a multi-way table; default * i.e. none

MEANS = tables
Table of means to be plotted; default obtains the table from the structure specified by the SAVE parameter or, if this too is unset, from the most recent ANOVA

BAR = scalars or tables
Scalar defining the length of error bar to be plotted to indicate the variability of the means or table defining the variability of each mean; default calculates the standard error for differences between means, if possible, from the SAVE structure (or from the most recent ANOVA) using the method specified by the PSE option

NEWXLEVELS = variates
Values to be used for XFACTOR instead of its existing levels

TITLE = texts
Title for the graph; default defines a title automatically

YTITLE = texts
Title for the y-axis; default ' '

XTITLE = texts
Title for the x-axis; default is to use the identifier of the XFACTOR

BARDESCRIPTION = texts
Information to label a bar provided by the BAR parameter; default ''

PENS = variates
Defines the pen to use to plot the points and/or line for each group defined by the GROUPS factors


Description

AGRAPH plots tables of means. In its simplest form, if none of the options nor parameters are specified, AGRAPH plots a high-resolution graph for the first two-way table of means in the most recent ANOVA, or for the first one-way table if there were no two-way tables. Usually, each mean is represented by a point. However, with high-resolution plots, the METHOD option can be set to lines to draw lines between the points, or data to draw just the lines and then also plot the original data values, or barchart to plot the means as a barchart. The GRAPHICS option controls whether a high-resolution or a line-printer graph is plotted; by default GRAPHICS=high.

   The MEANS parameter allows the table of means to be specified explicitly. If this is not set, AGRAPH obtains the table automatically, from the save stucture specified by the SAVE option. If the SAVE option is not set, they are taken from the analysis of the last y-variate to have been analysed by ANOVA. You can also plot predicted means from a regression analysis, by specifying a regression save structure (from the MODEL directive) instead of an ANOVA save structure. (Note that this also means that you can use save structures for an unbalanced analysis of variance from the AUNBALANCED procedure, as this uses the regression commands to do the analysis.) The means are then predicted by the AUKEEP procedure using the averaging and adjustment methods specified by the COMBINATIONS and ADJUSTMENT options; see AUKEEP for details.

   The BAR parameter can specify error bars (such as a standard error for differences between the means) to be plotted on the graph. If this is not specified, AGRAPH forms the bars from the SAVE structure (or from the most recent ANOVA) using the method specified by the PSE option, as follows:

    differences
average standard error of difference;

    lsd
average least significant difference;

    means
average effective standard error for the means;

    allmeans
plots plus and minus the effective standard error around every mean.

The LSDLEVEL option sets the significance level (%) to use for the least significant differences (default 5). The allmeans setting is often unsuitable when a two-way table is plotted as a graph (the plus/minus e.s.e. bars may overlap each other), and is not allowed when a two-way table is plotted as a barchart. If BAR is set, BARDESCRIPTION can provide a description to label the bar on the graph. When the bar is calculated, the description is formed automatically.

   The XFACTOR parameter indicates the factor against whose levels the means are plotted. With a multi-way table, a separate line will be plotted for every level of one or more other factors. If the table is being obtained automatically, these factors can be specified explicitly using the GROUPS parameter (in a pointer if there are several). If neither XFACTOR nor GROUPS are specified with a multi-way table, AGRAPH will select the XFACTOR according to the following criteria (in decreasing order of importance): that the factor has no labels, that it has levels that are not the default integers 1 upwards, or that it has more levels than the other factors. If you set both XFACTOR and GROUPS, you can then also use the TRELLISGROUPS option to specify one or more factors to define a trellis plot.

   Multi-way tables can be obtained from ANOVA and plotted, even if the corresponding model term was not in the analysis. For example you can plot a two-way table even if the analysis contained only the main effects of the two factors; however, the lines will then all be parallel and no standard errors or LSDs can be included.

   The NEWXLEVELS parameter enables different levels to be supplied for XFACTOR if the existing levels are unsuitable. If XFACTOR has labels, these are used to label the x-axis unless option XFREPRESENTATION=levels.

   The TITLE, YTITLE and XTITLE parameters allow you to supply titles for the graph, the y-axis and the x-axis respectively. The symbols, colours and line styles that are used in a high-resolution plot are usually set up by AGRAPH automatically. If you want to control these yourself, you should use the PEN directive to define a pen with your preferred symbol, colour and line style, for each of the groups defined by combinations of the GROUPS factors. The pen numbers should then be supplied to AGRAPH, in a variate, using the PENS parameter.

 

Options: GRAPHICS, METHOD, XFREPRESENTATION, PSE, COMBINATIONS, ADJUSTMENT, LSDLEVEL, SAVE.

Parameters: XFACTOR, GROUPS, TRELLISGROUPS, MEANS, BAR, NEWXLEVELS, TITLE, YTITLE, XTITLE, BARDESCRIPTION, PENS.


Method

To set the various defaults (if necessary) AGRAPH uses the GET directive to obtain the ANOVA save structure, AKEEP to obtain the TREATMENT formula, FCLASSIFICATION to obtain the first two factors and GETATTRIBUTE to discover which have labels and so on. If a regression save structure is supplied, the information is obtained using the AUKEEP procedure.