Description Usage Arguments Value Examples
Performs statistical inference tasks (point estimation, confidence interval, tests) for the mean of the distributions of scalar-valued data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
x |
A numeric vector providing the first sample. |
y |
A numeric vector providing the second sample. |
alternative |
A string specifying the type of alternative hypothesis.
Choices are |
mu |
A numeric value providing the value of the mean difference |
paired |
A boolean specifying whether the two samples are paired.
Defaults to |
conf_level |
A numeric value specifying the confidence level for the
computation of a confidence interval for the mean difference. Defaults to
|
B |
An integer specifying the number of permutations to use. Defaults to
|
A list with class "htest"
containing the following components:
statistic
: the value of the test statistic computed from the original
observed samples.
parameter
: the degrees of freedom of the null distribution of the test
statistic (not available for permutation tests).
p.value
: the p-value for the test.
estimate
: the estimated mean or mean difference mu_y - mu_x
depending
on whether it was a one-sample test, a paired two-sample test or an
independent two-sample test.
conf.int
: a confidence interval for the mean of for the mean difference
appropriate to the specified alternative hypothesis.
null.value
: the specified hypothesized value of the mean or mean
difference depending on whether it was a one-sample test or a two-sample
test.
stderr
: an estimate of the standard deviation of the estimator of the
mean or mean difference.
alternative
: a string describing the alternative hypothesis.
method
: a string indicating what type of test was performed.
data.name
: a string giving the name(s) of the data.
1 2 3 4 5 6 7 | x <- rnorm(10)
y <- rnorm(10)
z <- rnorm(10, mean = 3)
t1 <- t_test(x, y, B = 100)
t2 <- t_test(x, z, B = 100)
w1 <- wilcox_test(x, y, B = 100)
w2 <- wilcox_test(x, z, B = 100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.