mean: Inference for the Mean via Permutations

Description Usage Arguments Value Examples

Description

Performs statistical inference tasks (point estimation, confidence interval, tests) for the mean of the distributions of scalar-valued data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
t_test(
  x,
  y = NULL,
  alternative = c("two_tail", "left_tail", "right_tail"),
  mu = 0,
  paired = FALSE,
  var_equal = FALSE,
  conf_level = 0.95,
  B = 1000
)

wilcox_test(
  x,
  y = NULL,
  alternative = c("two_tail", "left_tail", "right_tail"),
  mu = 0,
  paired = FALSE,
  conf_level = 0.95,
  B = 1000L
)

Arguments

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 "two_tail", "left_tail" or "right_tail". Defaults to "tow_tail".

mu

A numeric value providing the value of the mean difference mu_y - mu_x under the null hypothesis. Defaults to 0.

paired

A boolean specifying whether the two samples are paired. Defaults to FALSE. Unused at the moment since one-sample tests are not yet available.

conf_level

A numeric value specifying the confidence level for the computation of a confidence interval for the mean difference. Defaults to 95%.

B

An integer specifying the number of permutations to use. Defaults to 1000L.

Value

A list with class "htest" containing the following components:

Examples

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)

astamm/piscalar documentation built on Dec. 19, 2021, 5:39 a.m.