my_t.test: T-Test

Description Usage Arguments Value Examples

View source: R/my_t.test.R

Description

This function performs a one sample t-test.

Usage

1
my_t.test(x, alternative, mu)

Arguments

x

The numeric vector of data.

alternative

Character string specifying the alternative hypothesis. This should only accept "two.sided", "less", or "greater".

mu

A number indicating the null hypothesis value of the mean.

Value

A list with elements:

test_stat

The numeric test statistic.

df

The degrees of freedom.

alternative

The value of the parameter alternative.

p_val

The numeric 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)

mzhang98/project3 documentation built on March 22, 2021, 1:51 p.m.