my_t.test: T-test function

Description Usage Arguments Value Examples

View source: R/my_t.test.R

Description

This function does one sample t-test.

Usage

1
my_t.test(x, alternative, mu)

Arguments

x

Numeric vector of data to be tested.

alternative

A string specifying the alternative hypothesis, only accept "two.sided", "less", or "greater".

mu

The null hypothesis of the mean of x.

Value

A list of t-test parameters, includes test_stat, df, alternative, and p_val.

Examples

1
2
3
my_t.test(my_gapminder$lifeExp, "two.sided", 60)
my_t.test(my_gapminder$lifeExp, "less", 60)
my_t.test(my_gapminder$lifeExp, "greater", 60)

Ranul-Liu/STAT302package documentation built on Dec. 18, 2021, 9:52 a.m.