DanielPlot: Normal Plot of Effects

DanielPlotR Documentation

Normal Plot of Effects

Description

Normal plot of effects from a two level factorial experiment.

Usage

DanielPlot(fit, code = FALSE, faclab = NULL, block = FALSE,
    datax = TRUE, half = FALSE, pch = "*", cex.fac = par("cex.lab"), 
    cex.lab = par("cex.lab"), cex.pch = par("cex.axis"), ...)

Arguments

fit

object of class lm. Fitted model from lm or aov.

code

logical. If TRUE labels "A","B", etc are used instead of the names of the coefficients (factors).

faclab

list. If NULL points are labelled accordingly to code, otherwise faclab should be a list with idx (integer vector) and lab (character vector) components. See Details.

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. Factors' labels character size.

cex.lab

numeric. Labels character size.

cex.pch

numeric. Points character size.

...

graphical parameters passed to plot.

Details

The two levels design are assumed -1 and 1. Factor effects assumed 2*coef(obj) ((Intercept) removed) are displayed in a qqnorm plot with the effects in the x-axis by default. If half=TRUE the half-normal plots of effects is plotted as the normal quantiles of 0.5*(rank(abs(effects))-0.5)/length(effects)+1 versus abs(effects).

Value

The function returns invisible data frame with columns: x, y and no, for the coordinates and the enumeration of plotted points. Names of the factor effects (coefficients) are the row names of the data frame.

Author(s)

Ernesto Barrios.

References

C. Daniel (1976). Application of Statistics to Industrial Experimentation. Wiley.

Box G. E. P, Hunter, W. C. and Hunter, J. S. (1978). Statistics for Experimenters. Wiley.

See Also

qqnorm, LenthPlot

Examples

### Injection Molding Experiment. Box et al. 1978.
library(BsMD)
# Data
data(BM86.data,package="BsMD")     # Design matrix and response
print(BM86.data)    # from Box and Meyer (1986)

# Model Fitting. Box and Meyer (1986) example 3.
injectionMolding.lm <- lm(y3 ~ X1 + X2 + X3 + X4 + X5 + X6 + X7 + X8 + X9 +
                    X10 + X11 + X12 + X13 + X14 + X15, data = BM86.data)
print(coef(injectionMolding.lm)) # Model coefficients

# Daniel Plots
par(mfrow=c(1,3),oma=c(0,0,1,0),pty="s")
DanielPlot(injectionMolding.lm, half = TRUE, main = "Half-Normal Plot")
DanielPlot(injectionMolding.lm, main = "Normal Plot of Effects")
DanielPlot(injectionMolding.lm,
        faclab = list(idx = c(12,4,13), lab = c(" -H"," VG"," -B")),
        main = "Active Contrasts")

BsMD documentation built on Sept. 19, 2023, 5:07 p.m.