t.test
.tsum.test(mean.x, s.x = NULL, n.x = NULL, mean.y = NULL, s.y = NULL,
n.y = NULL, alternative = "two.sided", mu = 0, var.equal = FALSE,
conf.level = 0.95)
x
x
x
y
y
y
"greater"
, "less"
or
"two.sided"
, or just the initial letter of each, indicating the specification
of the alternative hypothesis. For one-sample tests, alternative
rTRUE
, the variances of the parent populations
of x
and y
are assumed equal. Argument var.equal
should be supplied
only for the two-sample tests.htest
, containing the following components:"t"
parameters
has names attribute "df"
.conf.level
. When alternative
is not "two.sided"
, the confidence interval will be half-infinite,
to reflect the interpretation of a confidence interval as the set of all
values k
for which one would not reject the null hypothesis that
the true mean or difference in means is k
. Here infinity will be
represented by Inf
.estimate
has a names attribute describing its elements.mu
. Component
null.value
has a names attribute describing its elements.}"greater"
, "less"
or "two.sided"
.x
is drawn is mu
. For the standard and Welch modified
two-sample t-tests, the null hypothesis is that the population mean for x
less that for
y
is mu
.
The alternative hypothesis in each case indicates the direction of divergence of the population
mean for x
(or difference of means for x
and y
) from mu
(i.e., "greater"
, "less"
, or "two.sided"
).conf.int
) can be obtained in the usual
way by inverting the expression for the test statistic. Note that, as explained
under the description of conf.int
, the confidence interval will be half-infinite when
alternative is not "two.sided"
; infinity will be represented by Inf
."two.sided"
, and var.equal
determine the type of test. If y
is NULL
, a one-sample t-test is
carried out with x
.}
NULL
, either a standard or
Welch modified two-sample t-test is performed, depending on whether var.equal
is TRUE
or FALSE
.
}z.test
, zsum.test
round(tsum.test(mean.x=53/15, mean.y=77/11, s.x=sqrt((222-15*(53/15)^2)/14),
s.y=sqrt((560-11*(77/11)^2)/10), n.x=15, n.y=11, var.equal= TRUE)$conf, 2)
# Example 8.13 from PASWR
tsum.test(mean.x=4, s.x=2.89, n.x=25, mu=2.5)
# Example 9.8 from PASWR
Run the code above in your browser using DataLab