my_t.test: My t-test

Description Usage Arguments Value Examples

View source: R/my_t.test.R

Description

This function performs a t-test on a set of data against a hypothesis.

Usage

1
my_t.test(x, alternative, mu)

Arguments

x

Numeric vector of data on which t-test is performed.

alternative

String input that specifies the type of t-test to be performed on x, must be either "less" or "greater" for a one-sided t-test or "two.sided" for a two-sided test.

mu

Numeric representing the null hypothesis value of the mean.

Value

List with four elements: test_stat is a numeric contianing the value of the test statistic of x, df is a numeric containing the degrees of freedom used in the t-test, alternative is a string that represents the type of t-test used (the value of the alternative parameter), and p-val is a numeric containing the p-value for the t-test.

Examples

1
2
my_t.test(x = my_gapminder$lifeExp, alternative = "two.sided", mu = 55)
my_t.test(x = my_gapminder$gdpPercap, alternative = "greater", mu = 10000)

thulinjt/project3package documentation built on March 22, 2021, 2:41 p.m.