Statistics Toolbox    
aoctool

Interactive plot for fitting and predicting analysis of covariance models

Syntax

Description

aoctool(x,y,g) fits a separate line to the column vectors, x and y, for each group defined by the values in the array g. These types of models are known as one-way analysis of covariance (ANOCOVA) models. The output consists of three figures:

You can use the figures to change models and to test different parts of the model. More information about interactive use of the aoctool function appears on The aoctool Demo.

aoctool(x,y,g,alpha) determines the confidence levels of the prediction intervals. The confidence level is 100*(1-alpha)%. The default value of alpha is 0.05.

aoctool(x,y,g,alpha,xname,yname,gname) specifies the name to use for the x, y, and g variables in the graph and tables. If you enter simple variable names for the x, y, and g arguments, the aoctool function uses those names. If you enter an expression for one of these arguments, you can specify a name to use in place of that expression by supplying these arguments. For example, if you enter m(:,2) as the x argument, you might choose to enter 'Col 2' as the xname argument.

aoctool(x,y,g,alpha,xname,yname,gname,'displayopt') enables the graph and table displays when 'displayopt' is 'on' (default) and suppresses those displays when 'displayopt' is 'off'.

aoctool(x,y,g,alpha,xname,yname,gname,'displayopt','model') specifies the initial model to fit. The value of 'model' can be any of the following:

h = aoctool(...) returns a vector of handles to the line objects in the plot.

[h,atab,ctab] = aoctool(...) returns cell arrays containing the entries in ANOVA table (atab) and the table of coefficient estimates (ctab). (You can copy a text version of either table to the clipboard by using the Copy Text item on the Edit menu.)

[h,atab,ctab,stats] = aoctool(...) returns a stats structure that you can use to perform a follow-up multiple comparison test. The ANOVA table output includes tests of the hypotheses that the slopes or intercepts are all the same, against a general alternative that they are not all the same. Sometimes it is preferable to perform a test to determine which pairs of values are significantly different, and which are not. You can use the multcompare function to perform such tests by supplying the stats structure as input. You can test either the slopes, the intercepts, or population marginal means (the heights of the curves at the mean x value).

Example

This example illustrates how to fit different models non-interactively. First, we load the smaller car dataset and fit a separate-slopes model, then examine the coefficient estimates.

Roughly speaking, the lines relating MPG to Weight have an intercept close to 45.98 and a slope close to -0.0078. Each group's coefficients are offset from these values somewhat. For instance, the intercept for the cars made in 1970 is 45.98-8.58 = 37.40.

Next, we try a fit using parallel lines. (If we had examined the ANOVA table, we would have found that the parallel-lines fit is significantly worse than the separate-lines fit.)

Here we again have separate intercepts for each group, but this time the slopes are constrained to be the same.

See Also
anova1, multcompare, polytool


  anovan barttest