my_t.test: t-Test Function

Description Usage Arguments Value Examples

View source: R/my_t_test.R

Description

Performs one and two sample t-tests on vectors of data.

Usage

1
my_t.test(x, alternative, mu)

Arguments

x

A numeric vector of data.

alternative

a character string specifying the alternative hypothesis. This should only accept "two.sided", "less", or "greater". Otherwise, your function should throw an informative error.

mu

a number indicating the null hypothesis value of the mean.

Value

test_stat: the numeric test statistic.

df: the degrees of freedom.

alternative: the value of the alternative.

p_val: the numeric p-value.

Examples

1
2
my_t.test(y, alternative = "two.sided", 0)
my_t.test(y, alternative = "lass", 0)

SabrinaYuY/project3 documentation built on Dec. 18, 2021, 12:02 p.m.