halfnormal(x, ...)
## S3 method for class 'default':
halfnormal(x, labs, codes = NULL, pch = 1,
alpha = 0.05, xlab = "absolute effects", large.omit = 0, plot=TRUE,
crit=NULL, ...)
## S3 method for class 'lm':
halfnormal(x, labs = NULL, code = FALSE, pch = NULL,
alpha = 0.05, xlab = "absolute effects", large.omit = 0, plot=TRUE,
keep.colons = !code, ME.partial = FALSE,
external.pe = NULL, external.center = FALSE, contr.center = "contr.poly",
pch.set = c(1, 16, 8), scl = NULL, method="Lenth", ...)
## S3 method for class 'design':
halfnormal(x, labs = NULL, code = FALSE, pch = NULL,
alpha = 0.05, xlab = "absolute effects", large.omit = 0, plot=TRUE,
keep.colons = !code, ME.partial = FALSE,
external.pe = NULL, external.center = FALSE, contr.center = "contr.poly",
pch.set = c(1, 16, 8), scl = NULL, method="Lenth", ...)
ME.Lenth(b, simulated=TRUE, alpha=NULL)
CME.LW98(b, sterr, dfe, simulated=TRUE, alpha=NULL)
CME.EM08(b, sterr, dfe, simulated=TRUE, weight0=5, alpha=NULL)
design
design
or lm
: taken from the linear modelNULL
uses the labs
valuesTRUE
implies that factor letters
are used instead of factor codes, and that the default for default for
keep.colons
is changed to FALSE
NULL
, a number or a vector of plot symbol numbers
or the same length as the effects in x;
in the default method, a single number (default 1) implies that the given
plotting symbol is used for for all points;
for the oME.Lenth
, CME.LW98
and CME.EM08
,
alpha
can also be NULL
or a numeric vector;
for using the simFALSE
, plotting is suppressedcrit
value caNULL
; not meant for the end user; allows the method
option for linear models and experimental designs to choose alternatives
to Lenth's methodTRUE
, the automatic effect labels contain colons for interactionsTRUE
, partial aliasing among main effects is
permitted and will be orthogonalized awayTRUE
, external values from external.pe
are taken as center point values, and a nonlinearity check contrast is estimated
from themcontr.poly
or contr.XuWu
"Lenth"
applies Lenth's method to
the combined set of effects including error contrasts (if any);
the alternatives "LW98"
or "EM08"
apply the methods proposed by Larntz and Whitcomb (199plot
functionFALSE
, the original critical values from
Lenth 1989 are used, otherwise the methods use stored simulated values from a million
simulation runs for significance levels of 0.01, 0.02, ..., to 0.25b
, obtained from (a few, dfe
)
pure error degrees of freedom; the methods by Larntz and Whitcomb (1998) and
Edwards and Mee (2008) combine this with Lenth's methodsterr
was basedhalfnormal
visibly returns a character vector of significant
effects only. The methods for linear models and experimental designs invisibly return lists
of nine elements:
coef
contains the estimated coefficients
mm
contains the model matrix after adjustment to equally scaled independent effects
mod.effs
the effects that are part of the model
res
list that indicates the effects (named vector of position numbers)
that were projected out from any particular model effect (element name)
LCs
contains the coefficients of the linear combinations
taken from the residuals after projecting out the effects listed in res
from the original model matrix columns.
Where LCs
elements are NULL
, the original effect completely
disappeared because of complete confounding with previous effects.
alpha
contains the significance level
method
contains the method of significance assessment
signif
is a character vector of significant effects
pchs
is a numeric vector of plot character identifiers
The functions ME.Lenth
, CME.LW98
and CME.EM08
each
return lists of length 4 with an estimate for s0, PSE, ME and SME for Lenth's
method or their respective modifications for the other two methods (called
s0, CPSE, CME and CSME for CME.LW98
and Cs0, CPSE, CME and CSME for
CME.EM08
). The length of the (C)ME and (C)SME components depends on
the length of alpha (default: 25 critical values for alphas from 0.25 to 0.01).halfnormal
creates half normal effects plots with automatic
effect labelling according to significance. It also prints the significant
effects and creates an output object that contains only the vector if signifcant
effects (for the default method) or in addition several further components (see
section "Value").
The methods for linear models and experimental designs allow to automatically
create lack of fit and pure error contrasts to also be included in the plot,
following an orthogonalization strategy similar to Section 5 in Langsrud (2001).
Furthermore, they handle factors with more than two levels, and they handle partially
aliased effects by orthogonalizing out previous effects from later effects in
the model order (similar to what Langsrud 2001 proposed for multiple response
variables); thus, the plots are order dependent in case of partial aliasing.
The more severe the partial aliasing, the more drastic the difference between the
different effect orders. Per default, main effects are required to be
orthogonal; this can be changed via option ME.partial
.
The functions ME.Lenth
, CME.LW98
and CME.EM08
yield standard
error estimates and critical values for alpha in 0.01, 0.02, ..., 0.25. They are
use simulated critical values from a large number of simulations (1000000),
if the number of effects is in 7 to 143.
Outside of these situations, the half-normal plotting routines
will use the conservative approximations from Lenth (1989).DanielPlot
for (half) normal plots
of 2-level fractional factorial designs without partial aliasing
and ignoring any residual degrees of freedom### critical values
b <- rnorm(12)
ME.Lenth(b)
ME.Lenth(b)$ME
ME.Lenth(b, alpha=0.22)
ME.Lenth(b, alpha=0.123)
ME.Lenth(b, alpha=0.12)
ME.Lenth(rnorm(144), alpha=0.1)
(mel <- ME.Lenth(b, alpha=0.1))
## assuming an external effect standard error based on 3df
CME.EM08(b, 0.1, 3, alpha=0.1) ## much smaller than Lenth, if external
## standard error much smaller than s0
CME.EM08(b, mel$s0, 3, alpha=0.1) ## identical to Lenth, if the external
## standard error coincides with s0
### Half normal plots
## the default method
halfnormal(rnorm(15), labs=paste("b",1:15,sep=""))
b <- c(250, 8,7,6, rnorm(11))
halfnormal(b, labs=paste("b",1:15,sep=""))
halfnormal(b, labs=paste("b",1:15,sep=""), large.omit=1)
## the design method, saturated main effects design
plan <- oa.design(L12.2.11)
halfnormal(add.response(plan,rnorm(12)))
## the design method, saturated main effects design,
## partial aliasing due to a missing value
y <- c(NA, rnorm(11))
## the following line would yield an error, because there is even
## complete aliasing among main effects:
halfnormal(lm(y~., add.response(plan, y)), ME.partial=TRUE)
## this can only be helped by omitting a main effect from the model;
## afterwards, there is still partial aliasing,
## which must be explicitly permitted by the ME.partial option:
halfnormal(lm(y~.-D, add.response(plan, y)), ME.partial=TRUE)
## the linear model method
yc <- rnorm(12)
## partial aliasing only
halfnormal(lm(yc~A+B+C+D+E+F+G+H+J+A:B, plan))
## both partial (A:B) and complete (E:F) aliasing are present
halfnormal(lm(yc~A+B+C+D+E+F+G+H+J+A:B+E:F, plan))
## complete aliasing only because of the missing value in the response
halfnormal(lm(y~A+B+C+D+E+F+G+H+J+A:B+E:F, plan),ME.partial=TRUE)
## omit a large dominating effect
halfnormal(lm(y~A+B+C+D+E+F+G+H+J+A:B+E:F, plan),ME.partial=TRUE)
## a regular fractional factorial design with center points
y20 <- rnorm(20)
halfnormal(lm(y20~.^2, FrF2(16,7,ncenter=4)))
Run the code above in your browser using DataLab