DanielPlot: Normal or Half-Normal Effects Plots

View source: R/DanielPlot.R

DanielPlotR Documentation

Normal or Half-Normal Effects Plots

Description

The function is modified from the same-name function in packge BsMD with the purpose of providing more usage comfort (correct effect sizes in case of factors, automatic annotation, automatic labelling of the most significant factors only).

Usage

DanielPlot(fit, ...)
## S3 method for class 'design'
DanielPlot(fit, ..., response = NULL)
## Default S3 method:
DanielPlot(fit, code = FALSE, autolab = TRUE, alpha = 0.05, faclab = NULL, 
       block = FALSE, datax = TRUE, half = FALSE, pch = "*", 
       cex.fac = par("cex.lab"), cex.lab = par("cex.lab"), 
       cex.pch = par("cex"), cex.legend = par("cex.lab"), 
       main = NULL, subtitle=NULL, ...)

Arguments

fit

an experimental design of class design with the type element of the design.info attribute containing “FrF2” or “pb”
OR
object of class lm. Fitted model from lm or aov.

...

further arguments to be passed to the default function, or graphical parameters to be passed to plot; note that one should not use pch for split-plot designs.

response

NULL or a character string that specifies response variable to be used, must be an element of response.names(obj); if NULL, the first response from response.names(obj) is used

code

logical. If TRUE labels “A”,“B”, etc. are used instead of the names of the coefficients (factors). A legend linking codes to names is provided.

autolab

If TRUE, only the significant factors according to the Lenth method (significance level given by alpha) are labelled.

alpha

significanc level for the Lenth method

faclab

NULL or list. If NULL, point labels are automatically determined according to the setting of code (i.e. A,B,C etc. for code=TRUE, natural effect names otherwise) and autolab (i.e. all effects are labelled if autolab=FALSE, only significant effects are labelled if autolab=TRUE). Otherwise, faclab can be used for manual labelling of certain effects and should be a list with idx (integer vector referring to position of effects to be labelled) and lab (character vector of labels) components.

block

logical. If TRUE, the first factor is labelled as “BK” (block).

datax

logical. If TRUE, the x-axis is used for the factor effects the the y-axis for the normal scores. The opposite otherwise.

half

logical. If TRUE, half-normal plot of effects is display.

pch

numeric or character. Points character.

cex.fac

numeric. Factor label character size.

cex.lab

numeric. Labels character size.

cex.pch

numeric. Points character size.

cex.legend

numeric. Legend size in case of codes.

main

NULL or character. Title of plot. If NULL, automatic title is generated.

subtitle

NULL or character. Sub title of plot. Should not be used for split-plot designs, because automatic subtitle is generated for these.

Details

The design underlying fit has to be a (regular or non-regular) fractional factorial 2-level design. Effects (except for the intercept) are displayed in a normal or half-normal plot with the effects in the x-axis by default.

If fit is a design with at least one response variable rather than a linear model fit, the lm-method for class design is applied to it with degree high enough that at least one effect is assigned to each column of the Yates matrix, and the default method for DanielPlot is afterwards applied to the resulting linear model.

For split-plot designs, whole plot effects are shown as different plotting characters, because they are potentially subject to larger variability, and one should not be too impressed, if they look impressively large, as this may well be indication of plot-to-plot variability rather than a true effect.

Value

The function invisibly returns a data frame with columns: x, y, no, effect, coded (if coded plot was requested) and pchs, for the coordinates, the position numbers, the effect names, the coded effect names, and the plotting characters for plotted points.

The plotting characters are particularly useful for split-plot designs and can be used for subsequent separate plotting of whole-plot and split-plot effects, if necessary.

Note

If you load package BsMD after package FrF2, a mere call to function DanielPlot will use the function from package BsMD rather than the one from package FrF2. You can explicitly request usage of the FrF2 function by FrF2::DanielPlot.

Author(s)

Ernesto Barrios, modified by Ulrike Groemping.

References

Box G. E. P, Hunter, W. C. and Hunter, J. S. (2005) Statistics for Experimenters, 2nd edition. New York: Wiley.

Daniel, C. (1959) Use of Half Normal Plots in Interpreting Two Level Experiments. Technometrics 1, 311–340.

Daniel, C. (1976) Application of Statistics to Industrial Experimentation. New York: Wiley.

Lenth, R.V. (1989) Quick and easy analysis of unreplicated factorials. Technometrics 31, 469–473.

Lenth, R.V. (2006) Lenth s Method for the Analysis of Unreplicated Experiments. To appear in Encyclopedia of Statistics in Quality and Reliability, Wiley, New York. Downloadable at http://www.wiley.com/legacy/wileychi/eqr/docs/sample_1.pdf.

See Also

qqnorm, halfnormal, LenthPlot, BsMD-package


FrF2 documentation built on Sept. 20, 2023, 9:08 a.m.