behrens.test | R Documentation |
Behrens version of the t-test for unequal variances.
behrens.test(x, ...)
## Default S3 method:
behrens.test(
x,
y,
alternative = c("two.sided", "greater", "less"),
mu = 0,
conf.level = 0.95,
...
)
## S3 method for class 'formula'
behrens.test(formula, data, subset, na.action, ...)
x |
Numeric vector of data values. |
... |
Further arguments to be passed to or from methods. |
y |
Numeric vector of data values. |
alternative |
Character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater", and "less". |
mu |
A number indicating the difference in means under the null-hypothesis. |
conf.level |
Confidence level of the interval, default is 0.95. |
formula |
A formula of the form |
data |
An optional matrix or data frame
(or similar: see model.frame) containing the variables in the
formula formula. By default the variables are taken from |
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 |
Computes Behrens version of the t-test for unequal variances based on approximate solution as in Box & Tiao, 1973, Section 2.5.3; see also Armitage, Berry, Matthews, 2002, Section 4.3.
weightWomen <- c(38.9, 61.2, 73.3, 21.8, 63.4, 64.6, 48.4, 48.8, 48.5)
weightMen <- c(67.8, 60 , 63.4, 76, 89.4, 73.3, 67.3, 61.3)
# using the default method
behrens.test(x = weightWomen, y = weightMen)
behrens.test(x = weightWomen, y = weightMen, alternative = "less")
# using the formula interface
weight <- matrix(c(weightWomen, weightMen, rep(1, 9), rep(2, 8)), ncol = 2)
colnames(weight) <- c("measure", "sex")
behrens.test(measure ~ sex, data = weight)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.