my_t.test: t-test function

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

Numeric input of data.

alternative

Character input, either "greater", "less", or "two.sided", corresponding to what hypothesis is being tested.

mu

The numeric null hypothesis value.

Value

List with values: test_stat - Numeric representing test_statistic, df - Numeric representing degrees of freedom, alternative - Character either "greater", "less", or "two.sided", representing type of t-test, p_val - Numeric representing the p-value.

Examples

1
2
3
my_t.test(c(1:5), "greater", 4)
my_t.test(c(1:10), "less", 4)
my_t.test(c(1:5), "two.sided", 0)

toadmengo/Proj3Package documentation built on March 22, 2021, 2:41 p.m.