my_t_test: T-test Function

Description Usage Arguments Value Examples

View source: R/my_t_test.R

Description

This function run a one sample t-test.

Usage

1
my_t_test(x, alternative, mu)

Arguments

x

A numeric vector of data. value.

alternative

a character string specifying the alternative hypothesis. This should only accept "two.sided", "less", or "greater". Otherwise, the function should throw an informative error.

mu

A numeric indicating the null hypothesis value of the mean.

Value

A list of numeric including the t-value, the degrees of freedom, the alternative, and the p-value.

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)

RolinaC/STAT302PACKAGE documentation built on Dec. 18, 2021, 10:59 a.m.