my_t.test: the t-test calculator

Description Usage Arguments Value Examples

View source: R/my_t.test.R

Description

This function calculates values associated to the t-test such as the test statistics, p-value, degree of freedom, and the conclusion on whether we reject or fail to reject the null hypothesis tested from lifeExp data in the gapminder package.

Usage

1
my_t.test(x, alternative, mu)

Arguments

x

the numeric vector of lifeExp pulled from the gapminder data

alternative

the one-sided or two-sided test

mu

the mean value tested given from the null hypothesis (mu = 60)

Value

A list indicating test statistics, p-value, degree of freedom, and the conclusion on whether we reject or fail to reject the null hypothesis tested from lifeExp data in the gapminder package.

Examples

1
2
3
4
set.seed(302)
p <- 0.4
flip_coin <- rbinom(100, size = 1, prob = p)
my_t.test(as.numeric(flip_coin), alternative = "greater", mu = p)

hadiyusri/project3package documentation built on Dec. 20, 2021, 2:40 p.m.