A wrapper for t.test
which includes the original data in the returned
object.
t_test(x, ...)# S3 method for default
t_test(
x,
y = NULL,
alternative = c("two.sided", "less", "greater"),
mu = 0,
paired = FALSE,
var.equal = FALSE,
conf.level = 0.95,
...
)
# S3 method for formula
t_test(formula, data, subset, na.action, ...)
a (non-empty) numeric vector of data values.
further arguments to be passed to or from methods.
an optional (non-empty) numeric vector of data values.
a character string specifying the alternative
hypothesis, must be one of "two.sided"
(default),
"greater"
or "less"
. You can specify just the initial
letter.
a number indicating the true value of the mean (or difference in means if you are performing a two sample test).
a logical indicating whether you want a paired t-test.
a logical variable indicating whether to treat the
two variances as being equal. If TRUE
then the pooled
variance is used to estimate the variance otherwise the Welch
(or Satterthwaite) approximation to the degrees of freedom is used.
confidence level of the interval.
a formula of the form lhs ~ rhs
where lhs
is a numeric variable giving the data values and rhs
either
1
for a one-sample or paired test or a factor
with two levels giving the corresponding groups. If lhs
is of
class "Pair"
and rhs
is 1
, a paired test
is done.
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
environment(formula)
.
an optional vector specifying a subset of observations to be used.
a function which indicates what should happen when
the data contain NA
s. Defaults to
getOption("na.action")
.