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 vector of data.

alternative

Character string specifying the alternative hypothesis.

mu

Number indicating the null hypothesis value of the mean

Value

A list with four elements, test_stat, df, alternative, and p_value.

Examples

1
2
3
my_t.test(rbinom(100, size = 7, prob = 0.1), "greater", 0.9)
my_t.test(rbinom(100, size = 7, prob = 0.1), "less", 0.9)
my_t.test(rbinom(100, size = 7, prob = 0.1), "two.sided", 0.9)

eunicezh/STAT302package documentation built on Dec. 20, 2021, 6:43 a.m.