Description Usage Arguments Details Value Author(s) References See Also Examples
Performs Dunnett's test for comparing several treatments with a control.
1 2 3 4 5 6 7  DunnettTest(x, ...)
## Default S3 method:
DunnettTest(x, g, control = NULL, conf.level = 0.95, ...)
## S3 method for class 'formula'
DunnettTest(formula, data, subset, na.action, ...)

x 
a numeric vector of data values, or a list of numeric data vectors. 
g 
a vector or factor object giving the group for the
corresponding elements of 
control 
the level of the control group against which the others should be tested. If there are multiple levels the calculation will be performed for every one. 
conf.level 
confidence level of the interval. 
formula 
a formula of the form 
data 
an optional matrix or data frame (or similar: see

subset 
an optional vector specifying a subset of observations to be used. 
na.action 
a function which indicates what should happen when
the data contain 
... 
further arguments to be passed to or from methods. 
DunnettTest
does the post hoc pairwise multiple comparisons procedure.
If x
is a list, its elements are taken as the samples to be
compared, and hence have to be numeric data vectors. In this case,
g
is ignored, and one can simply use DunnettTest(x)
to perform the test. If the samples are not yet contained in a
list, use DunnettTest(list(x, ...))
.
Otherwise, x
must be a numeric data vector, and g
must
be a vector or factor object of the same length as x
giving
the group for the corresponding elements of x
.
A list of class c("PostHocTest")
, containing one matrix named after the control with columns diff
giving the difference in the observed means, lwr.ci
giving the lower end point of the interval, upr.ci
giving the upper end point and pval
giving the pvalue after adjustment for the multiple comparisons.
There are print and plot methods for class "PostHocTest"
. The plot method does not accept xlab
, ylab
or main
arguments and creates its own values for each plot.
Andri Signorell <andri@signorell.net>, the interface is based on RCore code
Dunnett C. W. (1955) A multiple comparison procedure for comparing several treatments with a control, Journal of the American Statistical Association, 50:10961121.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  ## Hollander & Wolfe (1973), 116.
## Mucociliary efficiency from the rate of removal of dust in normal
## subjects, subjects with obstructive airway disease, and subjects
## with asbestosis.
x < c(2.9, 3.0, 2.5, 2.6, 3.2) # normal subjects
y < c(3.8, 2.7, 4.0, 2.4) # with obstructive airway disease
z < c(2.8, 3.4, 3.7, 2.2, 2.0) # with asbestosis
DunnettTest(list(x, y, z))
## Equivalently,
x < c(x, y, z)
g < factor(rep(1:3, c(5, 4, 5)),
labels = c("Normal subjects",
"Subjects with obstructive airway disease",
"Subjects with asbestosis"))
DunnettTest(x, g)
## Formula interface
boxplot(Ozone ~ Month, data = airquality)
DunnettTest(Ozone ~ Month, data = airquality)
DunnettTest(Ozone ~ Month, data = airquality, control="8", conf.level=0.9)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs in the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.