my_t.test: T-test Calculator

Description Usage Arguments Value Examples

View source: R/my_t.test.R

Description

This function does the T-test with the input value, return the result as a list.

Usage

1
my_t.test(x, alternative = "two.sided", mu = 0)

Arguments

x

Numeric vector input, containing the values we are going to test.

alternative

String input specifying alternative hypothesis, defaults to "two.sided".

mu

Numeric input, indicating the null hypothesis value of the mean, defaults to 0.

Value

A list includes test_stat, the numeric test statistic; df, the degrees of freedom; alternative, the value of the parameter alternative; and p_val, the numeric p-value.

Examples

1
2
3
4
x <- rnorm(10, mean = 0, sd = 1)
my_t.test(x)
my_t.test(x, alternative = "less")
my_t.test(x, alternative = "greater", mu = 1)

Chaos-Gao/MyStat302Package documentation built on March 20, 2021, 2 p.m.