rp.anova: Interactive analysis of variance

View source: R/rp-anova.R

rp.anovaR Documentation

Interactive analysis of variance

Description

This function plots response data, separated by one or two factors. It also creates a panel which controls the models which can be fitted to the data and displayed on the plot. A comparison model can also be selected and the results of an F-test are displayed graphically.

Usage

rp.anova(y, x, z, model = NA, model0 = NA, ylab = NA, xlab = NA, zlab = NA, title = NULL,
         lines = TRUE, panel = TRUE, panel.plot = TRUE, hscale = 1.3,
         vscale = hscale / 1.3)

Arguments

y

a vector of response values.

x

a factor which splits y into different groups.

z

an optional second factor which splits y into a second set of groups.

model, model0

logical vectors of length 2 or 4, for one or two factors respectively, defining the initial and comparison models to be fitted. For one factor, the two values determine whether each of the terms for the intercept and x appear. For two factors, the four values determine whether each of the four terms intercept, x, z and x:z appear.

ylab

a character name used for the response variable.

xlab

a character name used for the first factor.

zlab

a character variable used for the response axis label.

title

a character variable supplying a title. (This is used only in the case where panel is FALSE.)

lines

a logical variable which determines whether lines are drawn to connect the estimated means for each group. This can be helpful in highlighting the relative positions of the means across the groups.

panel

a logical variable which determines whether a panel is created to allow interactive control of the fitted models.

panel.plot

a logical parameter which determines whether the plot is placed inside the panel (TRUE) or the standard graphics window (FALSE). If the plot is to be placed inside the panel then the tkrplot library is required.

hscale, vscale

scaling parameters for the size of the plot when panel.plot is set to TRUE.

Details

The data are displayed as points superimposed on a density strip created by the denstrip package. Selected models are displayed through the fitted values for each group. When a valid comparison model is selected, its fitted values are displayed along with a shaded regions expressing the contribution of the differences between the two sets of fitted values to the F-statistic. The F-test is displayed in graphical form with a density strip to represent the F-distribution and a point to indicate the observed value of the F-statistic.

Static plots, for printing or other purposes can be created by setting the panel argument to FALSE and specifying the models of interest.

Value

Nothing is returned.

References

rpanel: Simple interactive controls for R functions using the tcltk package. Journal of Statistical Software, 17, issue 9.

Examples

## Not run: 
   with(poisons, {
     rp.anova(1/stime, treatment, poison)
   })

## End(Not run)

rpanel documentation built on Feb. 16, 2023, 10:37 p.m.

Related to rp.anova in rpanel...